I’ve uploaded (yet another) update to the Objective-C REST client I’ve blogged about previously. This time I’ve scanned the code with the excellent LLVM/Clang Static Analyzer and fixed a couple of memory leaks here and there. I strongly recommend to scan your own projects with this tool, it’s extremely simple to use:
- Install it somewhere in your PATH;
Set your projects to use the Debug configuration when building from the command line (you can do that in the inspector for the project, in the “Configurations” tab);(see Sebastien’s comment below ;)- Open Terminal.app and fire
scan-build -k -V xcodebuild
on the root of the Xcode project folder; - If there are any problems with your code, you’ll have your web browser pop up with the list of problems, their description in annotated code format, and even a link to open the file right away.