Re: Why so many public properties all up in my grizzle?
Re: Why so many public properties all up in my grizzle?
- Subject: Re: Why so many public properties all up in my grizzle?
- From: Charles Srstka <email@hidden>
- Date: Sat, 17 Mar 2012 04:16:30 -0500
On Mar 17, 2012, at 3:45 AM, G S wrote:
> This pattern is pretty questionable though in terms of OO — you have one class (NSNib, UINib, etc.) directly setting instance variables in another class (your view controller) and using runtime functions to hack around things like @private.
>
> How do you figure? I'm not doing any manipulation of non-property members between classes. If you're saying that Cocoa does it when loading from a nib, then it's doing that anyway; properties aren't required for that action. From the end-user (end-programmer) perspective, I don't see any bad OO going on here.
So you have an ivar marked @private. How do you think that (NS)|(UI)Nib — an unrelated class that shouldn’t have access to your private ivars — sets the outlet variables to your nib objects? It does it via runtime hackery. If you declare a property, on the other hand, it just calls the setter. Much cleaner and more OO, if you ask me.
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