When you have an UIViewController
and UITableViewController
classes and you wanted to let these two do some common stuff in their - (void)viewDidLoad
how could you achieve this in Objective-C without actually duplicating your code?
I tried to create MyUIViewController
inheriting UIViewController
and implement viewDidLoad
in there. This perfectly works with UIViewController
classes obviously, but won't work in UITableViewController
, since I can't simply replace @interface MyTableViewController : UITableViewController
with @interface MyTableViewController : MyUIViewController
.
I believe this topic is about "multiple inheritance" in Objective-C language, but other than figuring out what's different in Objective-C, I'd really like to know how to do guys do such thing?