4

When I run with a connected iPad, I can enable NSZombieEnabled via "Enable Zombie Objects" or by passing NSZombieEnabled as an Environment Variable. However, I cannot seem to produce builds (i.e., the kind you archive and distribute ad-hoc) with NSZombie enabled.

How can I enable NSZombieEnabled for archive release builds?

The code I am using to determine if it's enabled from within the code is: (getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled"))

Dan Rosenstark
  • 68,471
  • 58
  • 283
  • 421
  • 2
    Why do you need NSZombieEnabled for an ad-hoc build? – Jack Lawrence Jan 14 '12 at 01:16
  • @JackLawrence Thanks for asking. I'm getting inexplicable crashes from one of my testers not unlike this http://stackoverflow.com/questions/1912131. Maybe I should be making some other kind of build for them? I have no physical access to these devices, myself. – Dan Rosenstark Jan 14 '12 at 01:52

1 Answers1

1

NSZombieEnabled is not what you need. You should have them send you their crash logs. Or you could use TestFlight's SDK to get crash reports sent to a web panel you can monitor. There you'll often be able to see where the crash is happening.

james_womack
  • 10,028
  • 6
  • 55
  • 74
  • Read the comments on the question. I believe that NSZombies would be useful – Dan Rosenstark Jan 24 '12 at 08:13
  • I did read the comments. NSZombiesEnabled is for debugging only, not for distributed releases of any kind. It won't work. There's a lot of confusion around this subject but I'm 100% sure NSZombiesEnabled is active only when debugging. – james_womack Jan 24 '12 at 12:16
  • If I deploy to the device via hitting "run" in Xcode, zombies are enabled, and they continue to work for the build even if it's run without debug being active. – Dan Rosenstark Jan 24 '12 at 22:27
  • I'm glad TestFlight helped you. I believe running through Xcode is not the same as a tester running a distribution build. I was told by someone in the Apple dev team that NSZombiesEnabled does nothing in distribution builds and I've accidentally left it on before with no issues. If I was misinformed, I apologize. I did find a question on SO that had the accepted answer contradicting me while the highest voted answer was in line with what I've been told by Apple. – james_womack Jan 25 '12 at 01:15
  • Sorry, you said you "left it on before with no issues." That was the question: how did you do it? I see no way to do it via targets in Xcode. – Dan Rosenstark Jan 25 '12 at 07:51
  • Yes. To actually be on it has to show up with `(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled"))`, of course. – Dan Rosenstark Jan 25 '12 at 18:47
  • 2
    I left it checked about a year ago when I was still using Xcode 3.2. The interface showed it as an active argument for the target but the compiler didn't use it because it was a distribution build. Now there isn't an option to do this in Xcode 4's archive scheme because NSZombiesEnabled wasn't created for distribution and the more refined UI now reflects that. There may be some other way to achieve adding it though. – james_womack Jan 26 '12 at 18:58
  • 1
    Thank goodness. I forgot to disable the NSZombie and then build the archive release. If it doesn't matter, I do not need to inform to testers. – Yeung Oct 22 '13 at 03:29