Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obj-C: call super class

- (void)viewDidAppear:(BOOL)animated {
    <CODE BEFORE>
    [super viewDidAppear:animated];
    <CODE AFTER>
}

What is correct, to put all code before or after the super call ? Its working both ways, but I don't know if its better to wait for the call until the end or submit it at the beginning ?

cheers endo

like image 759
endo.anaconda Avatar asked Dec 12 '22 16:12

endo.anaconda


1 Answers

The general rule of thumb is to call it first when setting things up (like here) and call it last when tearing things down.

like image 59
Eiko Avatar answered Dec 30 '22 04:12

Eiko