当问题解决后,要将NSDebugEnabled NSZombieEnabled MallocStackLogging 设置为无效,不需要删除变MallocStackLoggingNoCompact量,将变量前的对号去掉就可以了。
<==========================================================================>
xcode4以上的版本:Product -> Edit Scheme -> 右边框Diagnostic。
或:
Click the "Run Button Dropdown"
From the list choose Profile
The program "Instruments" should open where you can also choose Zombies
Now you can interact with your app and try to cause the error
As soon as the error happens you should get a hint on when your object was released and therefore deallocated.
As soon as a zombie is detected you then get a neat "Zombie Stack" that shows you when the object in question was allocated and where it was retained or released:
Event Type RefCt Responsible Caller
Malloc 1 -[MyViewController loadData:]
Retain 2 -[MyDataManager initWithBaseURL:]
Release 1 -[MyDataManager initWithBaseURL:]
Release 0 -[MyViewController loadData:]
Zombie -1 -[MyService prepareURLReuqest]