O'Reilly logo

Cocoa® by Richard Wentk

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

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 ...

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