ios - Is it a MUST for viewWillAppear to have [super viewWillAppear] method as well -


i placed code iad/admob ads in...

-(void)viewwillappear:(bool)animated{} 

ads work fine way have them on ios devices. when connected iphone xcode , clicked on product -->analyze message states...

the viewwillappear:instance method in uiviewcontroller subclass 'iphonesix' missing [super viewwillappear:] call

i accidentally stumbled upon product-->analyze thing. need add [super viewwillappear] though works fine on devices is. apple reject app if don't pay attention product-->analyze issue navigator?

also, ...

[super viewwillappear:yes]; 

what calling do?

apple doesn't gets specific when deciding accept or reject app. follows guidelines, doesn't weeds of specific methods.

calling [super viewwillappear:yes] best practice, , recommend it. including super ensures code in super classes called before executing additional code. if or else coded super class expected code executed, guaranteed still execute it, rather overwriting whole method in subclass.

say have view controller of type myviewcontroller subclass of uiviewcontroller. have view controller of type myotherviewcontroller, subclass of myviewcontroller. you're coding things in viewwillappear in myotherviewcontroller. if call super first, call viewwillappear in myviewcontroller before executing code. if viewwillappear in myviewcontroller calls super first, call viewwillappear in uiviewcontroller before executing code.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -