I am handling a UIWebView
so that i can control which URLs should be loaded within or not, but some how even though it is retuning the NO , it still load the page. Although documentation clearly says that if you return NO, the UIWebView
wont load the page.
When i debug,i can see it is returning NO
but still UIWebView
does load the URL.
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSLog(@"%@", [[request URL] absoluteString]);
NSString *fullURL = [[request URL] absoluteString];
NSRange range = [fullURL rangeOfString:@"#"];
if (range.length != 0) {
NSLog(@"We need to show the other view");
return NO;
}
return YES;
}