BrT

Musings about technology and other neat stuff

BrT random header image

WILTAC #3: NSZombieEnabled

October 17th, 2008 · 2 Comments

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.

Tags: · ·

2 responses so far ↓

  • 1  Dave // Dec 4, 2008 at 9:13 am

    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 // Jan 16, 2009 at 7:56 pm

    Thanks! I thought I was doing something wrong!