O'Reilly logo

The Complete Idiot's Guide® To iPad and iPhone App Development by Troy Brant

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required