• 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: Retain/Release and Properties clarification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retain/Release and Properties clarification


  • Subject: Re: Retain/Release and Properties clarification
  • From: Wade Tregaskis <email@hidden>
  • Date: Fri, 07 Oct 2011 10:20:30 -0700

> In addition to what Kyle replied, I'd just like to point out that prefixing your *methods* with an underscore is a very bad idea, since Apple does reserve such names and a conflict will bite you at runtime possibly affecting the binary compatibility of your app.

I would argue that underscores are fine to use, but only for the purpose of distinguishing "private" or "internal" methods, not namespaces.  If you are subclassing a class you don't control (other than NSObject or similar) you should prefix your methods with your own identifier, just like you would your class name.  This also extends to protocols and delegate methods.  I've encountered some rather interesting bugs due to Apple frameworks adding new methods with the same names, irrelevant of whether underscores are involved or not.  I assure you, Apple won't blink first in these cases. :)
_______________________________________________

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: 
 >Retain/Release and Properties clarification (From: John Tsombakos <email@hidden>)
 >Re: Retain/Release and Properties clarification (From: John Tsombakos <email@hidden>)
 >Re: Retain/Release and Properties clarification (From: Charles Srstka <email@hidden>)
 >Re: Retain/Release and Properties clarification (From: Sean McBride <email@hidden>)

  • Prev by Date: Problem with AVFoundation
  • Next by Date: Re: Retain/Release and Properties clarification
  • Previous by thread: Re: Retain/Release and Properties clarification
  • Next by thread: Re: Retain/Release and Properties clarification
  • Index(es):
    • Date
    • Thread