01.02.2014 Views

Objective-C Fundamentals

Objective-C Fundamentals

Objective-C Fundamentals

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Debugging techniques<br />

This chapter covers<br />

■<br />

■<br />

■<br />

■<br />

Creating a buggy application<br />

Using NSLog<br />

Controlling leaks with Instruments<br />

Detecting zombies<br />

There’s nothing worse than being close to releasing a new application and in your<br />

final once-over finding a particularly nasty application crash that seems to have no<br />

obvious cause. Even during day-to-day development of your application, it’s<br />

unlikely that you’ll write perfect code the first time around, so understanding how<br />

to debug your application in the Xcode environment is an important skill.<br />

The Xcode environment integrates a large number of debugging and code<br />

analysis tools, but as usual, their true power is only unleashed if you know which<br />

tool to use and how and when to use it. A common complaint for new <strong>Objective</strong>-C<br />

developers who are used to managed environments such as C# or Java is that memory<br />

management and correct handling of object retain counts (retain, release,<br />

autorelease, and dealloc message handling) is hard; so Xcode provides extensive<br />

support for detecting and diagnosing memory-related errors.<br />

276

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!