Initialization of DetailViewController


#1

DetailViewController is a subclass of UIViewController. We create its view in DetailViewController.xib via Interface Builder. According to the UIViewController Class Reference in the Apple documentation, the designated initializer for a UIViewController object is initWithNibName:bundle:. However, we initialize our DetailViewController instance with init in tableView:didSelectRowAtIndexPath:. We also don’t implement init in DetailViewController.m (in order to send the initWithNibName:bundle: message).

Since we created DetailViewController’s view in Interface Builder, initWithNibName:bundle: must be called at some point, correct? Is it called somewhere in the init chain?


#2

Let me guess.
Because by convention any other initializer - like init - should call the designated initializer, and it probably is implemented like that.
When you say we don’t implement init - I think then superclass’s init is called.