Re: Newbie Q - Variables not being retained in class
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