The following code works fine but when I go back to my app it keeps on executing the following code but I don't know why and how to stop it. I think it is only happening in ios5.0 : app flow - rootviewcontroller -> mainviewcontroller ->webview
the following code is called in shouldstartloadrequest method of a webview in mainviewcontroller
@property (readwrite, retain) UIWebView *_loginWebView;
...
..
- (void)viewDidLoad
{
[super viewDidLoad];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_loginWebView loadRequest:requestObj];
}
//following gets called whenever webview gets a request to open url
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
//return no is a special case there is more code in the method which I am not showing here
if ([[UIApplication sharedApplication] canOpenURL:myURL])
{
[[UIApplication sharedApplication] openURL:myURL];
}
else
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:newPath]];
}
return NO;
}
//above is a special case
}
head tag content -
<head>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<!-- iOS Stuff -->
<link rel="apple-touch-icon" href="images/...."/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="shortcut icon" href="favicon.ico" />
<script async="async" src="https://......."></script>
<script type="text/javascript">
..........
</script>
</head>