`[super viewDidLoad]` convention

My rule of thumb is: if you’re doing something related to initialization, always call the super class’s method first (if you are going to call it at all). This gives the super class a chance to do any set-up that you may be relying on later in your method. If you’re doing something related to destruction, call the super class’s method last. This makes sure that you can rely on the state of the object throughout the execution of your method. Finally, take any other case on a case-by-case basis. For instance, if you’re handling an event, you probably want to deal with the event first, and only invoke the super class’s method if you chose not to handle the event or if you somehow altered it and want to pass it along the event chain.

Leave a Comment