What is NSZombies?


 NSZombies is a runtime process that you can turn on with an environment variable, when it is on released objects are not returned to the heap, instead they are replaced with a “zombie” version of their class, for example _NSZombie_NSString.  These zombie classes implement receiveMessage to crash the application.

why crashing the application is useful? 

when it crashes, the object which called it will be in the stack trace — therefore you can quickly see where you are accessing a released object, without NSZombies the crash would happen in the next class which uses the same address, this could be quite distant from the spot where the bug really is.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s