Monday, November 23, 2009

iPhone dev Stupidity 103: NSZombie and Memory leaks

from here:

NSZombieEnabled creates leaks ON PURPOSE so you can track down calls to objects that are released prematurely. When you run with NSZombieEnabled, objects are never dealloced. When it's time to dealloc the object, NSZombieEnabled tells the runtime to turn the object into an instance of NSZombie. Any attempt to message an NSZombie will result in a runtime exception. Always remember to remove the NSZombieEnabled flag before sending an app into production! Due to the fact that dealloc is overridden, your app will never free any memory - it will just grow and grow. It's for testing and debugging only.


No comments: