Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5984347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:21:47+00:00 2026-05-22T22:21:47+00:00

I have NSZombieEnabled=YES set, and I want to do the following code – (NSString*)

  • 0

I have NSZombieEnabled=YES set, and I want to do the following code

- (NSString*) udid
{
    if (udid == nil) 
    {
        udid = [[UIDevice currentDevice] uniqueIdentifier];
        NSLog(@"UDID=%@", udid);
    }
    return udid;
}

it turns out when udid is “released”, it had been replaced with a Zombie, it’s not nil. So I want to do something like

if (udid == nil || [udid isZombie])
{
    udid = [[UIDevice currentDevice] uniqueIdentifier];
    NSLog(@"UDID=%@", udid);
}

I tried [udid isKindOf:[NSZombie Class]], but NSZombie does not exist. So how can I tell is the udid object a Zombie now?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:21:47+00:00Added an answer on May 22, 2026 at 10:21 pm

    A pointer to an object is never set to nil when the object is released. The pointer continues to point to the same memory location that it always did. That doesn’t mean that whatever is now at that location is a valid object, however. For that reason, you should never use a pointer after you’ve released the object it points to. If you’re going to continue to use that pointer, you should change its value so that it’s either nil or points to some other (valid) object.

    NSZombieEnabled is just a debugging tool that helps you find places in your code where you’re accessing invalid objects. If you’ve found a place where you’re doing that, you’ve found a bug in your code and you need to fix it, not tolerate it.

    Change your code so that you properly set your udid pointer to nil once you’ve released it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have you guys had any experiences (positive or negative) by placing your source code/solution
Have you managed to get Aptana Studio debugging to work? I tried following this,
I want to enable NSZombies for my iPhone app. I have read several articles
I've got a retain/release problem. My View is pretty complicated so I've set NSZombieEnabled
I have the following method in UIImageManipulation.m : +(UIImage *)scaleImage:(UIImage *)source toSize:(CGSize)size { UIImage
i have a problem with a exc bad access. I already turned in NSZombieEnabled,
Have the following scenario. I have a few form, which essentially have a few
Have String str May 23 2011 12:20:00, want to convert it to date such
Have this result set below; am trying to insert the red numbers into post_position
Have just started using Google Chrome , and noticed in parts of our site,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.