• 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: Newbie Q - Variables not being retained in class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Q - Variables not being retained in class


  • Subject: Re: Newbie Q - Variables not being retained in class
  • From: Charlton Wilbur <email@hidden>
  • Date: Fri, 9 Sep 2005 13:54:59 -0400


On Sep 9, 2005, at 12:48 PM, Daniel Jalkut wrote:

It's also possible that your entire class has been deallocated, and whatever is now in its place happens to be using that offset for "zero". What happens if you add a call:

NSLog(@"My retain count is %d", [self retainCount]);

To you savePreferences method?

At best? confusing numbers, likely difficult to impossible to interpret, because you don't know what other code is retaining/ autoreleasing that variable. At worst? crash! because self has been dealloc'd. -retainCount is simply not useful for debugging except in very specific instances, and its results are more likely to confuse novice programmers than anything else.


Charlton


-- Charlton Wilbur email@hidden email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Newbie Q - Variables not being retained in class (From: Aaron Wallis <email@hidden>)
 >Re: Newbie Q - Variables not being retained in class (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: Newbie Q - Variables not being retained in class
  • Next by Date: Re: How to add toolbar into Mail.App
  • Previous by thread: Re: Newbie Q - Variables not being retained in class
  • Next by thread: Re: Newbie Q - Variables not being retained in class
  • Index(es):
    • Date
    • Thread