Reference URL: Https://stackoverflow.com/questions/3906704/when-should-i-call-super
If you rewrite the Viewwillappear and Viewwilldisappear methods while writing the code, but do not invoke [super Viewwillappear] and [Super Viewwilldisappear], use the static analysis tool (Shortcut COMMAND + SHIFT + B) problem occurs when analyzing
If the problem is shown and the Xcode gives a description of the problem:
/viewcontroller.m:29:1: The ' viewwillappear: ' instance method in Uiviewcontroller subclass ' Viewcontroller ' is missing a [ Super Viewwillappear:] Call
/viewcontroller.m:29:1: The ' viewwillappear: ' instance method in Uiviewcontroller subclass ' Viewcontroller ' is missing a [ Super Viewwillappear:] Call
If the super method is called, no problem will occur when using the static analysis tool.
So if we are going to execute other code inside these two methods, should we call Super first or call the other code we want to execute first?
Https://stackoverflow.com/questions/3906704/when-should-i-call-super
That's what StackOverflow said, as shown in the above.
You can write this later.
1- (void) Viewwillappear: (BOOL) animated{2 [Super viewwillappear:animated];3 //the code to execute is called here4 5 6 }7 8- (void) Viewdidappear: (BOOL) animated{9 //the code to execute is called hereTen [Super viewdidappear:animated]; One}
Please correct me if there is any mistake.
If you want to reprint please specify the source thank you
Overriding Viewwillappear and Viewwilldisappear [Super Viewwillappear] and [super Viewwilldisappear] Call locations