Re: NSTextView retainCount weirdness
Re: NSTextView retainCount weirdness
- Subject: Re: NSTextView retainCount weirdness
- From: j o a r <email@hidden>
- Date: Fri, 8 Jul 2005 08:08:01 +0200
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.
And the question that always needs to be asked: What are you *really*
trying to accomplish here?
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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