I have a method like this:
- (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
if ([request.URL.scheme isEqualToString:@"aaa"])
openURL:[NSURL URLWithString:@"www.firstwebsite.com"];
if ([request.URL.scheme isEqualToString:@"abc"])
openURL:[NSURL URLWithString:@"http://www.someurl.com"];
if ([request.URL.scheme isEqualToString:@"xyz"])
openURL:[NSURL URLWithString:@"http://www.anothersite.com"];
return YES;
}
and on the second and third uses of openURL I get a compile error: redefinition of label openURL
Any idea why that happens and how to resolve it?
Thanks!
This is because you should be using the “
UIApplication” methodopenURL:.In other words, instead of doing:
do