This is probably not be the best solution, but it should get it done.
Define - initFromSubClassWithNibName: bundle:;
in MySuperClass.h
and implement it like this:
- (id) initFromSubClassWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
return [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
}
and in MySubClass
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
return [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
}
This way you can escape MySuperView
's implementation of the init
method and use UIViewController's implementation. You can take the same approach with
awakeFromNib`. This will avoid creating a table view programmatically.
Then you can take GuillaumeA's answer to initialize tableView
from the IB.