如何解决“帧加载中断"? UIWebView中出现错误? [英] How to resolve "Frame Load Interrupted" error in UIWebView?
问题描述
在与我签约建造的应用中,我要提取一个YouTube视频列表,并允许它们显示在该应用中.但是,当用户点击YouTube视图的导航控制器中的某个单元格,并出现带有UIWebView的模式视图时,UIWebView将返回错误帧加载中断".
In an app I'm contracted to build, I'm pulling a list of YouTube videos and allowing them to be displayed in the app. However, when a user taps a cell in the YouTube view's navigation controller and the modal view with a UIWebView appears, the UIWebView returns the error "Frame load interrupted."
我已经在调试器中运行了数十次,在初始化NSURLRequest之前,一切似乎都进行得很顺利.显示模式视图时,以下是在ViewController的-viewDidLoad
方法中运行的代码:
I've run it through the debugger dozens of times, and everything seems to go well until I initialize the NSURLRequest. When the modal view is displayed, here is the code that runs in the ViewController's -viewDidLoad
method:
- (void)viewDidLoad
{
[super viewDidLoad];
_webView = [[UIWebView alloc] init];
_webView.delegate = self;
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:_url];
[_webView loadRequest:request];
}
但是,当我在[_webView loadRequest:request];
行上打开调试器时,会看到以下内容:
However, when I pull up the debugger on the line [_webView loadRequest:request];
, I see the following:
有人知道为什么UIWebView返回错误吗?
Does anyone know why the UIWebView is returning the error?
推荐答案
您应检查URL路径
它应该是@" http://google.com "
而不是@"google.com"
You should check the URL path
It should be @"http://google.com"
instead of @"google.com"
这篇关于如何解决“帧加载中断"? UIWebView中出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!