• 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 + return of autoreleased CFType
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC + return of autoreleased CFType


  • Subject: Re: ARC + return of autoreleased CFType
  • From: Matt Neuburg <email@hidden>
  • Date: Thu, 20 Oct 2011 13:43:13 -0700

On Oct 20, 2011, at 1:20 PM, Greg Parker wrote:

> On Oct 20, 2011, at 10:11 AM, Matt Neuburg wrote:
>> You know there's a rule that Create means a retained ref is returned
>
> There is no such rule in the Cocoa memory management conventions.
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html
>
> There is a "Create" rule in the convention for CoreFoundation functions, but that convention does not apply to Objective-C methods.

Sure, but still, he's returning a retained CGColorRef. And CGColor participates in this convention (CGColorRelease, CGColorRetain, CGColorCreate etc.). I'm not saying he has to do it; I'm merely suggesting that the magic word "Create" will help him remember what he's trying to remember, namely that he's returning a retained CGColorRef and the caller will need to call CGColorRelease on it later. m._______________________________________________

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

  • Follow-Ups:
    • Re: ARC + return of autoreleased CFType
      • From: Bill Cheeseman <email@hidden>
    • Re: ARC + return of autoreleased CFType
      • From: Charles Srstka <email@hidden>
References: 
 >Re: ARC + return of autoreleased CFType (From: Matt Neuburg <email@hidden>)
 >Re: ARC + return of autoreleased CFType (From: Greg Parker <email@hidden>)

  • Prev by Date: WebView doesn't scroll
  • Next by Date: Re: Get my NSDocument-based application out from "Open With" menu?
  • Previous by thread: Re: ARC + return of autoreleased CFType
  • Next by thread: Re: ARC + return of autoreleased CFType
  • Index(es):
    • Date
    • Thread