• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Enabling NSZombieEnabled programatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling NSZombieEnabled programatically


  • Subject: Re: Enabling NSZombieEnabled programatically
  • From: Graham Cox <email@hidden>
  • Date: Sun, 10 Jan 2010 11:54:11 +1100

On 10/01/2010, at 10:26 AM, Jim Correia wrote:

> On Jan 9, 2010, at 6:22 PM, Sean McBride wrote:
>
>> I've never tried, but NSDebug.h seems to say that there is an
>> NSZombieEnabled global var that you can set.
>
> Read the warning at the top of the header. While those variables have been there as long as I can remember, as soon as you ship software which relies on them, Murphy will invoke his law.
>
> (For debug and pre-release builds, go wild. For production builds, take appropriate precautions.)


Thanks Jim & Sean, that seems to be very simple.

I'm getting something odd though. If I set NSZombieEnabled during app delegate -applicationDidFinishLaunching: method from my preference, a later deliberate over-release still causes a EXC_BAD_ACCESS. If I set it as an environment variable (Xcode launch arguments for my app) I get the zombie logged as expected. In either case I can see that NSZombieEnabled is YES, but directly setting it doesn't appear to work.

Any idea what I'm doing wrong?

Code:

#include <Foundation/NSDebug.h>


- (void)		applicationDidFinishLaunching:(NSNotification*) aNotification
{
	NSZombieEnabled |= [[NSUserDefaults standardUserDefaults] boolForKey:@"NSZombieEnabled"];

	//[other stuff..]

	if( NSZombieEnabled )
		NSLog(@"NSZombieEnabled is ON");
}


--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Enabling NSZombieEnabled programatically
      • From: Quincey Morris <email@hidden>
    • Re: Enabling NSZombieEnabled programatically
      • From: Jim Correia <email@hidden>
    • Re: Enabling NSZombieEnabled programatically
      • From: Dave Keck <email@hidden>
References: 
 >Enabling NSZombieEnabled programatically (From: Graham Cox <email@hidden>)
 >Re: Enabling NSZombieEnabled programatically (From: "Sean McBride" <email@hidden>)
 >Re: Enabling NSZombieEnabled programatically (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: [iPhone] NSCoder Question
  • Next by Date: Re: [iPhone] NSCoder Question
  • Previous by thread: Re: Enabling NSZombieEnabled programatically
  • Next by thread: Re: Enabling NSZombieEnabled programatically
  • Index(es):
    • Date
    • Thread