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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to