Use Analysis Tools to Debug Memory Problems
To identify problems with your code at compile time, you can use the Clang Static Analyzer that is built into Xcode.
If memory management problems do nevertheless arise, there are other tools and techniques you can use to identify and diagnose the issues.
Many of the tools and techniques are described in Technical Note TN2239, iOS Debugging Magic, in particular the use of NSZombie to help find over-released object.
You can use Instruments to track reference counting events and look for memory leaks. See Collecting Data on Your App.