Re: Autorelease/Retain/Release
Re: Autorelease/Retain/Release
- Subject: Re: Autorelease/Retain/Release
- From: "Shawn Erickson" <email@hidden>
- Date: Tue, 24 Jul 2007 18:59:10 -0700
On 7/24/07, Tim Davis <email@hidden> wrote:
How do I know what is an accessor method/convenience method?
That is the wrong question.
You should ask yourself did "I" get reference to the object using a
method that starts with "alloc", "new", or contains the word "copy" in
it or is the method documented to follow the "create" rule?
If the answer is no then you don't have a claim (retain) on the object
and hence that object could disappear on you at sometime in the future
(often when the current autorelease pool is drained).
I would review the following more closely...
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043>
-Shawn
_______________________________________________
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