• 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: ARC and autorelease pools
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC and autorelease pools


  • Subject: Re: ARC and autorelease pools
  • From: John McCall <email@hidden>
  • Date: Sun, 16 Feb 2014 14:17:20 -0800

On Feb 16, 2014, at 1:03 PM, Jens Alfke <email@hidden> wrote:
> On Feb 16, 2014, at 10:22 AM, Kevin Meaney <email@hidden> wrote:
>
>> I didn't say take them out. I said why do they need to return an autoreleased object. Why can't they just return an object like alloc init... does.
>
> Because if they returned an object that wasn't autoreleased (i.e. that the caller needs to release), non-ARC code that called the method would leak the returned object.
>
> These methods have been around for a long time and their semantics can't be changed just because ARC now exists, at least not until some hypothetical future OS release where ARC becomes mandatory.

Also, the ARC model doesn’t support a mandatory cut-over like that.  Returning +0 is essentially part of the calling convention: if you know exactly what you’re calling, and you know exactly what’s calling it, maybe then you could automatically change it.  In Objective-C both of those conditions are impossible.

John.
_______________________________________________

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: 
 >ARC and autorelease pools (From: Kevin Meaney <email@hidden>)
 >Re: ARC and autorelease pools (From: Jens Alfke <email@hidden>)
 >Re: ARC and autorelease pools (From: Kevin Meaney <email@hidden>)
 >Re: ARC and autorelease pools (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: ARC and autorelease pools
  • Next by Date: Re: NSUndoManager, NSTableView with bindings
  • Previous by thread: Re: ARC and autorelease pools
  • Next by thread: Re: ARC and autorelease pools
  • Index(es):
    • Date
    • Thread