iOS UIWebView错误信息: frame load interrupt

来源:互联网 发布:苹果ai软件 编辑:程序博客网 时间:2024/06/14 02:21

一般来说是URL中少了http://或https://


示例:

- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{   // Intercept the external http requests and forward to Safari.app    // Otherwise forward to the PhoneGap WebView    if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) {        [[UIApplication sharedApplication] openURL:url];        return NO;    }    else {        return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];    }}
if ([url.scheme isEqualToString:@"file"]) {    NSLog(@"Open start page");    [[UIApplication sharedApplication] openURL:url];    return NO;}


1 0
原创粉丝点击