0

Sometimes I set NSZombieEnabled environment argument to YES for debugging.

This time I forgot to turn off the option, and submitted my application to App Store.

I suppose this option is just an environment option, so and does not affect to submitted application.

Am I correct?

tokentoken
  • 682
  • 7
  • 15

2 Answers2

6

Depends on how you set it. It is possible to toggle at runtime.

If you have just set it in the environment in Xcode, then -- no -- it won't be set when run on a device outside of Xcode.

(Note that zombie detection enabled uses a ton of memory because it effectively causes no object to be deallocated, just marked as "should have been deallocated")

bbum
  • 162,346
  • 23
  • 271
  • 359
  • Thank you for your answer. Yes, I set it with Xcode, like this screen capture. http://www.tomwhitson.co.uk/blog/2009/04/debugging-with-nszombiesenabled/ – tokentoken Aug 08 '10 at 23:31
  • You may want to read this post as well: http://stackoverflow.com/questions/1622079/break-on-exc-bad-access-in-xcode/1622091#1622091 – iwasrobbed Aug 09 '10 at 00:08
  • Where did you get that info bbum? – beOn Sep 09 '10 at 20:36
  • Do you have a link to the source? – beOn Sep 13 '10 at 16:53
  • It appears this is correct. I've tested by setting it in the environment in XCode and displaying an alert on startup if it's set. The alert displays in the simulator when built for any configuration, but never displays on the device. It would be nice to see some documentation that explains how this works, though. – Christopher Pickslay Sep 28 '10 at 22:35
0

To add some clarity to this answer:

I just ran a test. I inserted this code into my app at startup:

if(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled"))
    assert(NO);

I then configured XCode as per the image below.

NSZombieEnabled in xcode

I launched my app on the device in the debugger. As expected, it crashed with an assertion failure. I then disconnected the debugger and launched the application normally on the device. No crash.

Thus, provided you configure NSZombieEnabled in XCode in the manner below, it looks like you are OK submitting to app store.

esilver
  • 27,713
  • 23
  • 122
  • 168