I am getting this error when I deploy to my iPad. It does not occur in the simulator.
My ipad app has three UIWebViews. The majority of this application is written completely as a web app, and uses CSS to make it look more native. Links that are clicked in the various web views will open in a certain one depending on the value of the request variable "iPadTarget."
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSURL *url = [request URL];
//Extract the value from request variable 'iPadTarget' in url string.
NSString *test = [url query];
int index = [test rangeOfString:@"iPadTarget="].location;
int target = index + 11;
NSLog(@"%i", target);
char c = [test characterAtIndex:target];
NSLog(@"%c",c);
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
if (c == '1') {
[viewOne loadRequest:request];
return NO;
} else if (c == '2') {
[viewTwo loadRequest:request];
return NO;
} else if (c == '3') {
[viewThree loadRequest:request];
return NO;
}
}
return YES;
[url release];
}
The above code locates the variable "iPadTarget" and extracts its value (1 to 3). Why am I get this strange error? Any help is appreciated.