• 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 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

  • Follow-Ups:
    • Re: ARC + return of autoreleased CFType
      • From: Greg Parker <email@hidden>
  • Prev by Date: Re: IBOutlet getter/setter pattern question
  • Next by Date: CD database breaks after lightweight migration?
  • Previous by thread: Re: ARC + return of autoreleased CFType
  • Next by thread: Re: ARC + return of autoreleased CFType
  • Index(es):
    • Date
    • Thread