Documentation for -release is not quite true
Documentation for -release is not quite true
- Subject: Documentation for -release is not quite true
- From: Jerry Krinock <email@hidden>
- Date: Mon, 23 Aug 2010 18:35:35 -0700
Kind of late in the decade for this, but anyhow, the documentation for -release says:
- (oneway void)release
Decrements the receiver’s reference count.
Discussion. The receiver is sent a dealloc message when its reference count reaches 0.
So it's always bothered me that if I override -dealloc and log the retainCount on the way in, it is 1, not 0.
Upon doing some experiments, I believe that the first sentence in that documentation is wrong. It should say this instead:
If the receiver's retainCount is greater than 1, decrements it. Otherwise, invokes -dealloc.
Reading the document Memory Management Programming Guide ▸ Object Ownership and Disposal, one gets a similar false impression, although this document is vague enough that it is only misleading, not wrong.
OK, someone tell me why I'm wrong about this :)_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden