• 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: Properties, Attributes and Retain+Autorelease
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properties, Attributes and Retain+Autorelease


  • Subject: Re: Properties, Attributes and Retain+Autorelease
  • From: Kyle Sluder <email@hidden>
  • Date: Wed, 29 Jun 2011 11:51:04 -0700

On Wed, Jun 29, 2011 at 10:39 AM, Markus Hanauska <email@hidden> wrote:
> Yes, it talks about certain*exceptions*, and you are right, one of them is in fact destroying the parent, so I'm wiling to accept that you must not rely upon an object to stay alive longer than its parent.  However, have you also read the top paragraph?
>
> "Cocoa’s ownership policy specifies that received objects should typically remain valid throughout the scope of the calling method. It should also be possible to return a received object from the current scope without fear of it being released. It should not matter to your application that the getter method of an object returns a cached instance variable or a computed value. What matters is that the object remains valid for the time you need it."
>
> This principle is violated by a getter returning an object that is not retain+autorelease, since even without destroying the parent the returned object might go away. As pointed out in my other mail:

Yes, but all of this is already well-known. FWIW, nothing about atomic
guarantees that the object is returned retained/autoreleased.

All of your criticisms are valid, but they're the precise criticisms
that ARC addresses.

--Kyle Sluder
_______________________________________________

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: 
 >Re: Properties, Attributes and Retain+Autorelease (From: Matt Neuburg <email@hidden>)
 >Re: Properties, Attributes and Retain+Autorelease (From: Markus Hanauska <email@hidden>)
 >Re: Properties, Attributes and Retain+Autorelease (From: Kyle Sluder <email@hidden>)
 >Re: Properties, Attributes and Retain+Autorelease (From: Markus Hanauska <email@hidden>)

  • Prev by Date: Re: problem with applying md5 to data
  • Next by Date: Display Letterboxing Pillarboxing
  • Previous by thread: Re: Properties, Attributes and Retain+Autorelease
  • Next by thread: Re: Properties, Attributes and Retain+Autorelease
  • Index(es):
    • Date
    • Thread