mac_ch18.eps
co_bar.eps

Chapter 18: Debugging, Optimizing, and Managing Code

mac_chbox18.eps

In This Chapter

Using the console and NSLog

Debugging with breakpoints and the Debugger window

Using instruments

Managing code with Snapshots and Source Control

Xcode includes a powerful suite of tools for profiling, testing, and debugging code. You can test your application in three ways:

bl.eps Logging messages to the console.

bl.eps Setting breakpoints, single-stepping through code and checking property values in a debugging window.

bl.eps Using instruments — a collection of test tools that can report on memory use, thread states, application performance, object allocations, and memory leaks.

By default, Xcode supports two different build configuration options for both OS X and iPhone OS projects: Release and Debug. You can select these using the build drop-down menu at the top left of the Xcode window, as shown in Figure 18.1.

The Debug option ...

Get Cocoa® 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.