Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initializers in Categories?




In this case, Ross, there's nothing to worry about really - especially if you'd create a class method like [NSButton robRossStyleButton] that instantiates a button and configures it to your liking ... Create your (RobRossButtonAdditions) category and fire away.


One caveat -- respect encapsulation. In other words, don't mess with the iVars directly. Instead, you should use available methods such as -setButtonStyle: etc.

--
I.S.


On Jul 13, 2006, at 3:54 PM, Rob Ross wrote:

The only thing I can think of at the moment is perhaps you have a class with a lot of ivars and accessors, and you want to use a group of them in some part of your code, and rather then having to make a lot of [... setXXX] calls, create a convenience initializer that will initialize the set of ivars you care about in one call.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >initializers in Categories? (From: Rob Ross <email@hidden>)
 >Re: initializers in Categories? (From: "A.M." <email@hidden>)
 >Re: initializers in Categories? (From: Rob Ross <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.