Friday, April 17, 2009

Killing bugs before they happen on the iPhone

You can easily set up a Static Analyzer, which will check your Objective-C code for bugs, like memory leaks, dead assignments, etc, without actually running the app on the iPhone (that's why "static"). Check out this tutorial to setup the LLVM/Clang Static Analyzer for iPhone Apps.

You need to dirty your hands slightly with the Terminal to run the analyzer. You might want to add analyzer to your path to your .bash_profile so that you can run the analyzer from anywhere.

When you run the analyzer, you will see a bug report with links to your source files to show you the exact line where you have a bug. Sweet!

No comments: