Re: NSTextView retainCount weirdness
Re: NSTextView retainCount weirdness
- Subject: Re: NSTextView retainCount weirdness
- From: Nicko van Someren <email@hidden>
- Date: Fri, 8 Jul 2005 11:17:44 +0100
On 8 Jul 2005, at 7:08, j o a r wrote:
On 8 jul 2005, at 07.04, Duncan Campbell wrote:
If I do the following:
NSTextView *foo = [[NSTextView alloc] init];
NSLog(@"foo: %i",[foo retainCount]);
I get a retainCount of 3. Can someone explain why?
Very rarely does it make sense for you to try to track the actual
value of the retain count for an object in this way. Objects can be
retained and released for reasons that are an implementation detail
of their design that might not be immediately obvious to you. In
this particular case, it's likely that you're seeing the effect of
retain+autorelease, and that the net retain count of this object is
still in reality 1.
Apropos of this, is there a straight forward way to find out the
count of pending (auto) releases on an object?
Nicko
_______________________________________________
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