I have a UIWebView that loads a page with an html button. When user taps that button, “http://somerequest” is loaded.
I am capturing the request in shouldStartLoadWithRequest (in the code below) and when “http://somerequest” is requested, a segue is performed with identifier “Comments”:
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
NSURL *url = [request URL];
if([[url absoluteString] isEqualToString:@"http://somerequest"])
{
[self performSegueWithIdentifier:@"Comments" sender:self];
return NO;
}
return YES;
}
“performSegueWithIdentifier” is working properly but the shouldStartLoadWithRequest function is not returning “NO”. If I remove “performSegueWithIdentifier”, the function is able to return NO.
Please tell me how I can perform the segue when the UIWebView requests “http//somerequest” and does not load the request in current UIWebView (by returning ‘NO’).
Try this :
Any way set a break point to make sure ‘ returnValue = NO;’ is called.
Shani