ViewController, Subclassing and Super


I don’t understand why you would want to call, for example, in viewDidLoad method - [super viewDidLoad].
The same is done in viewWillAppear and viewWillDisapear (p.142).

I thought these methods defined in UIViewController do nothing and are there so we can override them
in our subclasses…so why do you call super in viewDidLoad, viewWillAppear and viewWillDisapear?


The Apple documentation requests that you call the superclasses implementation. Perhaps UIViewController doesn’t currently run any code in its implementations of these methods, but it might in the future. UIViewController subclasses that you override (like UITableViewController) will implement code in their implementations of these methods.