I want to reload a simple UIWebView I have loaded when the app opens and closes from the iPad Home Button.
I’ve searched other questions, but none seem to fit as I don’t want an extra button or Tab or something else in my app.
I tried:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[webView reload];
}
but this doesn’t react. My initialization code is in a controller derived from UIViewController and the UIwebview is initialized in – (void)viewDidLoad
Any clue how to do this?
Kind regards
As people have pointed out you probably want the
applicationWillEnterForeground:call but don’t be tempted to add a load of junk to your app delegate.Instead – you should register to receive this notification when you init the
UIViewControllerthat contains theUIWebView.Then implement the refresh method something like:
You will need to unregister in your dealloc to avoid any nasty suprises something like this