Static Code Analysis with Xcode
Xcode comes with a static code analysis tool which can help to find the following issues:
- Logic flaws, such as accessing uninitialized variables and dereferencing null pointers
- Memory management flaws, such as leaking allocated memory
- Dead store (unused variable) flaws
- API-usage flaws that result from not following the policies required by the frameworks and libraries the project is using
see also Apple iOS Developer Guide
A nice feature is the presentation of the problem in separated steps, so it is really easy to reconstruct the detected problem.