Re: Debugging retainCount
Re: Debugging retainCount
- Subject: Re: Debugging retainCount
- From: Jeff Harrell <email@hidden>
- Date: Tue, 15 Jul 2003 08:08:54 -0500
On Tuesday, July 15, 2003, at 08:02 AM, publiclook wrote:
Why aren't you following the simple rules?
None of my business, but that could have been phrased better.
I do agree that the number of autoreleases should not exceed the total
number of retains plus one.
Another way of saying this is that the number of autoreleases shouldn't
exceed the object's retainCount. One of the things the tripped me up
when I was a Cocoa newbie (more of a newbie, I mean) was the fact that
newly allocated objects already have a retainCount of 1. This makes
sense once you realize that a retainCount of zero means death, but it's
initially counterintuitive. How can the retainCount be 1 if I haven't
retained it yet?
It's not a big thing, but it confused me, and I can see how it might
confuse others. This isn't really relevant to what you said, but I'll
take any opportunity to clear this point up. ;-)
--
email@hidden
http://homepage.mac.com/jharrell
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.