I'm using UIWebView inside my iOS app and I'm displaying a web app I have added to the actual project. Inside shouldStartLoadWithRequest I'm handling clicks on links (local files I'm opening in the same UIWebView, and web links I'm opening in Safari).
Everything works fine, except for one particular web link. When the app opens Safari with that url, and when I close Safari and go back to the app, I'm being automatically redirected to Safari again, and the same web site is displayed.
Weird thing is, none of the View Lifecycle methods are being called, nor none of the UIWebViewDelegate methods. I have no idea how can I prevent this behavior.
Any thoughts?
Solved by registering for notification on ApplicationDidBecomeActive. I've put this
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];
into (void)viewDidLoad method, and then wrote handler function that's being called via selector (didBecomeActive)
That's it.