Re: Retain/Release and Properties clarification
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