Why is my UIViewController initializer never called?
- by mystify
I made a view-based project from a fresh template. There's a UIViewController which is created with an XIB.
In the implementation I uncommented that and added an NSLog. But this is never called:
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
// Custom initialization
NSLog(@"nib");
}
return self;
}
since that is initialized from a nib / xib, that should be called for sure, right? however, it doesn't. I do get an NSLog message when I put that in viewDidLoad.