If in doubt, use protocols. @protocol MyProtocol <NSObject>
@property NSString *data1; // … @end Then reference the objects as id<MyProtocol> objects (or NSOperation<MyProtocol>) On Apr 7, 2014, at 22:17, Trygve Inda <cocoa...@xericdesign.com> wrote: > Hi have three different NSOperation subclasses: > > MyOperationA : NSOperation > MyOperationB : NSOperation > MyOperationC : NSOperation > > Each of my subclasses have a set of 4 required properties: > > NSString* data1 > NSString* data2 > NSString* data3 > NSString* data4 > > Beyond that, my three subclasses are different. I was thinking about making > a base class: > > MyBaseClass : NSOperation > > That only had synthesized properties and no methods. The methods (and > additional class-specific properties) would be provided by the subclass: > > MyOperationA : MyBaseClass etc. > > This way, when accessing the 4 data properties, I can just use a type > specification of MyBaseClass rather than having to know which specific type > of operation I am working with. > > Thoughts? > > Thanks, > > Trygve > > > > _______________________________________________ > > 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/xcvista%40me.com > > This email sent to xcvi...@me.com
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ 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