How to Use the Debug Area and Debug Navigator for iOS App Development

Writing bug free code for your iOS app can be tricky. 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. You select the Debug navigator by showing the Navigator area and then selecting the Debug navigator in the Navigator selector bar. The default behavior is to show the Debug navigator and the relevant debugging gauges (you can change this in Debug preferences).

image0.jpg

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.

Hitting a breakpoint displays the Debug area and Debug navigator.

image1.jpg

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

image2.jpg

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 should explore on your own.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com