Ok, this is going to be a really embarrassing question, but I looked like mad in my beginner’s books (especially those usually helpful indices) and behold, I did not find a down-to-earth explanation of what ‘super’ does in my applications.
I had a look at this here, but I’m afraid that’s well beyond me. Can anyone offer a very simply explanation of what ‘super’ does in my apps and why I should become friends with it? E.g.:
- (void)viewDidLoad {
[super viewDidLoad];}
Thanks!!
supercalls the superclass’s implementation of the method. So if your class inheritsUIViewController, then[super viewDidLoad];will call theUITableViewControllerclass’sviewDidLoadmethod. You should usually do this because the super class may do important things that need to happen. In the case of viewDidLoad, I’m not sure it actually does anything currently, but it always could in a future version of the framework.