25. Debugging

As you develop an app, you’ll find at times that the app isn’t behaving quite as you expected. Maybe the screen layout seems off, or maybe the app is just crashing. Xcode provides a number of useful tools for finding and fixing bugs. In this chapter we’ll discuss these tools as well as the more general question of narrowing down and finding the source of problems.

Understand the Problem

The first thing you need to do when confronted with a bug is to get the most detailed, accurate picture of the problem that you can. Getting a clear picture of the bug from the outside is a crucial first step in understanding what is wrong on the inside. Diving right into the code is rarely the best approach.

What Went Wrong?

The first step is making ...

Get Learning iPad Programming: A Hands-On Guide to Building iPad Apps with iOS 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.