Debugging memory management problems with NSZombieEnabled
Recently had an EXEC_BAD_ACCES issue, so decided to google, to find what people do in such cases, and found NSZombieEnabled. This thing is great. It helps very much. iPhone development guide says:
To activate the NSZombieEnabled facility in your application: Choose Project > Edit Active Executable to open the executable Info window. Click Arguments. Click the add (+) button in the “Variables to be set in the environment” section. Enter NSZombieEnabled in the Name column and YES in the Value column. Make sure that the checkmark for the NSZombieEnabled entry is selected.
and that's all you have to do. When this variable is set to YES, and you're trying to dealloc anything, runtime changes it's class name to _NSZombie dynamically and memory is not marked as free. So you have something like a repository of deallocated objects, and _NSZombie is watching for all dealocated objects. Everytime you're trying to send a message to a Zombie your console is populated with new message like this:
2009-12-27 11:41:22.476 App[1982:20b] *** -[CFString compare:]: message sent to deallocated instance 0x3da1e30
and it's quit descriptive as you can see. So from now I'll use this feature wherever needed. It's cool.
...Blog posts that helped me much:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/9781-trouble-setting-nszombieenabled.html http://cocoa-nut.de/?p=16
My partner and i without doubt realize all you now have reported. In reality, My partner and i shopped through your alternative content articles and I believe you happen to be fully appropriate. Congrats using this web blog.
greetings web master, your site page’s style is undoubtedly exceptional and then trusting doing it. Your current gives advice will be impressive. Make sure you keep up to date the beneficial do the trick. Meets.
brilliant areas forever, mobile computer got an innovative new person who reads. What would one would suggest regarding a submit that you created a full week some time ago? Any kind of good?
When understand examples of the blogposts with your internet site due to the fact recently, and so i undeniably prefer your manner of posting. I really bookmarked as their favorite them that will my top picks site selection and will be looking to come back soon. Please pay a visit to this site way too and then let me know a impression.
Pretty website! A touch too spammy yet