• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Multiple Inheritance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Multiple Inheritance (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: NSMutableData capacity
  • Next by Date: Re: stringWithFormat / Rendering Text (iOS)
  • Previous by thread: Re: Multiple Inheritance
  • Next by thread: Page number in UIWebView
  • Index(es):
    • Date
    • Thread