WILTAC #3: NSZombieEnabled

I learned today about the NSZombieEnabled environment variable (this is its correct name, and not NSZombiesEnabled as stated in Hillegass’ book). If you set it to YES, whenever you try to send a message to a deallocated object you will get a message like this in the console:

message sent to deallocated instance 0xe02b790

And the debugger is automatically started. This can be very useful for debugging memory management problems. Instead of a crash, you get an informative error message.


2 responses to “WILTAC #3: NSZombieEnabled

  1. Funny that the text in his book is incorrect, but the picture is correct. I apparently looked at the picture when I turned on zombies in my app.

  2. Dennis Christopher

    Thanks! I thought I was doing something wrong!

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