Re: Retain/Release and Properties clarification
Re: Retain/Release and Properties clarification
- Subject: Re: Retain/Release and Properties clarification
- From: Charles Srstka <email@hidden>
- Date: Mon, 03 Oct 2011 13:23:25 -0500
On Oct 3, 2011, at 10:14 AM, John Tsombakos wrote:
> (and will also change to use the underscore ivar names too - I had done that previously, but...well, didn't this time.)
I recommend using some other prefix system instead of the underscore, for two reasons:
1. Apple reserves the underscore prefix for their own use, so you could, at least theoretically, clash with a superclass ivar this way, and
2. KVO’s “access instance variables directly” (mis)feature recognizes the underscore prefix. I like to give it a prefix that KVO doesn’t know about so that I can be sure never to end up accidentally accessing the ivars of another object without going through the proper accessors.
3. If I use an ivar prefix that no one else uses (as far as I know), then I can make my class into a subclass of something from a publicly available framework without needing to worry about ivar name clashes.
Charles_______________________________________________
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