Alex Rivera | Logout

Multiple inheritance in Objective-C

Asked 2010-12-21T14:06:51.090
12

Possible Duplicate:
Objective-C multiple inheritance

I want to implement multiple inheritance in Objective-C i.e. I have a class "Sub" which needs to be a sublass of class "Super" as well as UITableViewController

How can I acheive the same in Obj-C?

Edit
Report

1 Answer

5

There is no multiple inheritance in Objective-C. You can try to resolve what you need to with composition though.

Something like this:

@interface MyViewController : UIViewController {
    Sub *mySubComponent;
}
@property (nonatomic, retain) Sub *mySubComponent;
// you can write wrapper methods here to call mySubComponent methods/messages
answered 2010-12-21T14:11:54.643

Your Answer