When you create apps for iOS 6 using Xcode 4, Apple has made it easier to write code with fewer bugs, as well as use the debugger to track down bugs you do have.

The Debug area consists of the Debug bar, partnered with the Variables pane and the Console pane, each of which has a Scope bar fitted out with a pop-up menu. You usually use the Debug area in conjunction with the Debug navigator.

You access the Debug area by selecting it in the Xcode toolbar’s View selector (as shown in this figure). You select the Debug navigator by showing the Navigator area and then selecting the Debug navigator in the Navigator selector bar.

Truth be told, though, there’s nothing much to see in the Debug area or Debug navigator unless your application is actually running. And although the Debug area’s Variables and Console panes will retain the results from your last program execution, the Debug navigator shows content only when your application is paused.


If you get a runtime error (or if you click the Pause button or a breakpoint is triggered), the Debug area and the Debug navigator open automatically.

This figure shows what happens when you hit a breakpoint in your program.


What you see in the Debug area is controlled by using the Debug area Scope bar, shown here. You use this bar to toggle between the Variables pane only (left button), both Variables and Console panes (center button), and Console pane only (right button).


The Variables pane and the Console pane have their very own Scope bars as well. The pop-up menu in the Variables pane Scope bar lets you display

  • Auto: Recently accessed variables

  • Local: Local variables

  • All: All variables and registers

The pop-up menu in the Console pane Scope bar lets you display

  • All Output: Target and debugger output

  • Debugger Output: Debugger output only

  • Target Output: Target output (program logging to the debugger, for example) only

Xcode offers other controls and filters for what gets displayed that you can explore on your own.