“super” in Objective-C

A good explanation on “super” in Objective-C

"super" means Super Class, or the parent class that your current class extends.

@interface MyViewController : UIViewController{}

In the code above, that you can find in some .h files, MyViewController extends UIViewController. So, all the time that you call "super" inside MyViewController, you are calling the UIViewController.

So, when you see the following structure, inside MyViewController…

- (void)viewDidLoad {
    [super viewDidLoad];
    .
    .
}

… it means that when the method "viewDidLoad" is called, it will first call the method from it’s super class, to after run it’s own code.

source: stackoverflow.com

Advertisements