Re: Multiple Inheritance
Re: Multiple Inheritance
- Subject: Re: Multiple Inheritance
- From: Jens Alfke <email@hidden>
- Date: Thu, 24 May 2012 08:41:23 -0700
Implement both A and B in the base class M, but don't declare them in its @interface. Then MAB and MAX can both declare method A and have implementations that just call super. Likewise for B.
Or, factor out A into a helper class, and similarly for B. Then have MAB and MAX instantiate an A helper object and delegate method A to it.
Or, similarly to #2, implement A and B as functions that take the 'receiver' object as the first parameter. Then you can easily implement method -A as a call to A(self).
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden