Implement abstract classes that implement the methods, then use the runtime to 
copy the methods into the classes that should have them in +initialize.

Bob

On 24 May 2012, at 10:14, Gerriet M. Denkmann wrote:

> I have an abstract class M with subclasses MAB, MAX, MXB.
> 
> There are several lengthy methods A which are used in MAB and MAX, and others 
> methods B which are used in MAB and MXB.
> 
> Methods A use a property NSUInteger index.
> Class MXB has no such property, is has NSIndexSet *indices instead.
> 
> Similar for methods B.
> 
> Currently these common methods are present in both classes.
> But: this is less than perfect - meaning that each change has to be done 
> twice. 
> 
> What to do?
> Have a file methodsA.m which is included in both MAB and MAX (and same for 
> methodsB.m) ?
> 
> Other, better solutions?
> 
> 
> Kind regards,
> 
> Gerriet.
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> 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/tom.davie%40gmail.com
> 
> This email sent to [email protected]


_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to