Please suggest the best way to solve memory leak problems on iphone. What is the best use of release, auto-advertising, preservation, and what cases do each of them apply to?
This is a very broad question. I would start with Apple 's Memory Management Programming Guide for Cocoa .
There are many questions that point to various memory management resources. These include
You can track memory leaks with tools: see this tutorial .
If you are familiar with Valgrind , you use it in x86 binaries created for the iPhone Simulator SDK: see how Landon Fuller does it .
EDIT: fooobar.com/questions/230477 / ... offers the Clang analyzer: static code analysis can also detect memory allocation errors. I have never used this tool myself, but it would be helpful to know this.
There Apple Instruments.app is located in the / Developer / Applications folder, which is designed to test applications for leaks and other errors.
I believe that you will find a good tutorial.
Also see Apple Introduction to User Guide Tools .