Reputation: 31
How can I do something like this ?
@interface SomeClass:NSViewController **:NSTableViewController** @end
How can i put two subclases in my class ??
Upvotes: 1
Views: 168
Reputation: 104698
Objective-C does not support Multiple Inheritance.
Typically, you work around this by using protocols when you want to program to an interface.
@interface SomeClass : NSViewController < SomeProtocol >
@end
Another option is composition:
@interface SomeClass : NSObject
{
@private
NSViewController * viewController;
NSTableViewController * tableViewController;
}
@end
Upvotes: 7