Re: Properties vs Instance Variables
Re: Properties vs Instance Variables
- Subject: Re: Properties vs Instance Variables
- From: Joanna Carter <email@hidden>
- Date: Wed, 27 Apr 2011 17:09:44 +0100
Le 27 avr. 2011 à 16:52, Matt Neuburg a écrit :
> And Apple now exemplifies this pattern, e.g. in the app template for Window-based Application: there's a "window" property accessing a "_window" ivar. I think they do this just so you can't accidentally say "window" unqualified. m.
I also think that Apple is (finally) starting to use the @private and @protected visibility specifiers in templates which, although they are not as "strict" as in other languages, start to educate people not to use ivars directly.
I too would like to see a means of explicitly accessing the ivar, even if it has the same name as the property; although, I thought that not calling self.property from within the .m file defaulted to accessing the ivar if both it and a property existed?
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
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