• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Autorelease/Retain/Release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Autorelease/Retain/Release (From: Tim Davis <email@hidden>)

  • Prev by Date: Autorelease/Retain/Release
  • Next by Date: Re: Autorelease/Retain/Release
  • Previous by thread: Autorelease/Retain/Release
  • Next by thread: Re: Autorelease/Retain/Release
  • Index(es):
    • Date
    • Thread