Re: ARC + return of autoreleased CFType
Re: ARC + return of autoreleased CFType
- Subject: Re: ARC + return of autoreleased CFType
- From: Matt Neuburg <email@hidden>
- Date: Thu, 20 Oct 2011 10:11:31 -0700
On Wed, 19 Oct 2011 11:47:22 -0600, John Pannell <email@hidden> said:
>- (CGColorRef)CGColorCopy
The CG prefix is not yours to use at the start of a method name. Start with your own prefix.
Also, follow the convention that if you're handing back a newly created retained object, the word Create appears early in the title. You know there's a rule that Create means a retained ref is returned, so use that rule in your own name, so that when you come back to this code in a year you'll know what's happening.
Also, be descriptive as to what this method does. "Copy" doesn't really cut it. So, maybe call this something like MyCGColorCreateWithCalibratedSpace (or something - I'm not entirely clear on the purpose of the method).
m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
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