I have an app that is crashing with no error tracing. I can see part of what is going on if I debug, but can't figure out which object is "zombie-ing".
Does anybody know how to enable NSZombie in Xcode 4?
In the "Product" menu, select "Edit Scheme". Go to the "Run Foo. app" stage in the left panel, and the "Arguments" tab on the right. Add NSZombieEnabled to the "Environment Variables" section and set the value to YES , as you could in Xcode 3.
Go to Project -> Edit Active Executable Click Arguments Click + in the "Variables to be set in the environment" section Enter NSZombieEnabled in the Name column and YES in the Value column. Make sure the checkmark for the NSZombieEnabled entry is checked.
It's a memory debugging aid. Specifically, when you set NSZombieEnabled then whenever an object reaches retain count 0, rather than being deallocated it morphs itself into an NSZombie instance. Whenever such a zombie receives a message, it logs a warning rather than crashing or behaving in an unpredictable way.
Environment variables are now part of the "scheme".
To edit the scheme and turn on zombies:
In the "Product" menu, select "Edit Scheme".
Go to the "Run Foo.app" stage in the left panel, and the "Arguments" tab on the right.
Add NSZombieEnabled
to the "Environment Variables" section and set the value to YES
, as you could in Xcode 3.
In Xcode 4.1 and above, there's also a checkbox on the "Diagnostics" tab of the "Run" stage to "Enable Zombie Objects".
With Xcode 6.4:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With