Objective-C Programming: Working with Static Analyzer in Xcode 3.2

Images
Hi folks, I wanted to talk about Static Analysis in XCode. For you iPhone and Mac developers, this new feature available in Snow Leopard and xCode 3.2, the advanced warning identifier that goes hand in hand with your normal compiler, providing a richer and deeper understanding of your code. It looks for logical anomalies, such as memory leaks, something your normal run of the mil compiler does not find, all within the confines of not having to leave xCode. This tool is an excellent facilitator for early Objective-C developers like myself, by showing you how memory management works.

Menuitem

You access the analysis tool by going to Build > Build and Analyze, in your menu, which allows it to build and analyse, rather than run.  If you manage to get a memory leak, the Static Analyzer will present the warning as follows:

Objleak
If you had uninitialised code, your warning would look like this:
Uninitialized
Creating a Static Analysis Build Configuration
To put this feature as part of your default configuration, such as to automatically analyse your code whenever you build your project, you create a custom build, by going to Debug Configuration, and duplicating the Debug configuration, opening it, and Enabling Static Analysis for this build configuration

More information
Advertisements
This entry was posted in General and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s