Enable Guard Malloc
April 18, 2009 § Leave a comment
In Xcode, you can select “Enable Guard Malloc” under Run menu. It will verify if you overrun the out of bounds of a heap allocated memory block.
Under Project menu select “Edit Active Executable”, select “Arguments” tab to add the following to the environment variables section.
If you check the boxes, Xcode will check autorelease and release showing a more in depth stack trace. NSZombieEnabled is an environment variable that request runtime to use “zombie” objects. These objects step in the place of deallocated objects and any messages sent to these objects will be logged. It helps to track any deallocation issues. Note: it will show nothing if your code is good.