Debugging on iPhone OS Devices
There are two primary debugging techniques at your disposal on iPhone OS devices:
1. GDB: Add breakpoints. Step through code line by line. See the values of your instance variables. Knowing how to use GDB in Xcode is absolutely essential for all iPhone programmers.
2. NSLog: This is by far the most popular technique. Use NSLog to print out values to the console or just to see how far your code gets before the app crashes.
On iPhone OS devices, each of these techniques has their place. GDB should be the tool you use for most of your debugging, but there are times when NSLog is the best way to get the information you need.
Let’s start off by taking a look at debugging using GDB.