On Mar 16, 2012, at 2:00 PM, Brian Lambert wrote:

> 
> To me, this is how things should be. The implementation details of how my
> view works are hidden.
> 
> Am I missing something?


Part of the problem was that prior to Xcode 4, IBOutlets needed to be declared 
in the header, or Interface Builder wouldn't find them (ditto for IBActions). 
As such the best you could do was declare the instance variables in the header 
and pre-pend them with IBOutlet, then declare your properties in a class 
extension.

That time has passed now, so you can now completely specify IBOutlets (and 
IBActions) in your implementation file and hide the details from the outside 
world. If you want properties, you can use a class extension like so to add 
them:

@interface ViewController()

@property …
// etc

@end

And you can just declare your IBActions on methods that you don't expose to the 
outside world entirely.
--
David Duncan

_______________________________________________

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