Chapter 12. Checking Your Code Using Xcode's Instruments Application

In This Chapter

  • Measuring application performance

  • Looking at object allocation

  • Finding memory leaks

  • Keeping in mind that the Simulator is not the device

Before you attempt to get your application into the App Store, or even run it on anyone's iPhone, you need to make sure it's behaving properly. By that I mean not only delivering the promised functionality, but also avoiding the unintentional misuse of iPhone resources. Keep in mind that the iPhone, as cool as it may very well be, is nevertheless somewhat resource-constrained when it comes to memory usage and battery life. Such restraints can have a direct effect on what you can (and can't) do in your application. Xcode's Instruments application lets you know how your application uses iPhone resources such as the CPU, memory, network, and so on.

The Instruments application allows you to observe the performance of your application while running it on the IPhone, and to a lesser extent, while running it on the Simulator. Here instrument means a specialized feature of the Instruments application that zeroes in on a particular aspect of your app's performance (such as memory usage, system load, disk usage, and the like) and measures it. What's really neat, however, is the fact that you can look at these different aspects simultaneously along a timeline — and then store data from multiple runs, so you get a picture of how your application's performance changes when you tune ...

Get iPhone™ Application Development for Dummies® 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.