iOS 7 UIWebView无法加载网页

Bru*_*sai 11 uiwebview ios7

我的应用程序使用UIWebview,它在iOS 5和iOS 6中运行良好.但是,当我在Xcode 5中构建并运行相同的代码时,它不会在iOS 7中加载网页.

 - (void)webViewDidFinishLoad:(UIWebView *)webView {}
 - (void)webViewDidStartLoad:(UIWebView *)webView {}
 - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {}
Run Code Online (Sandbox Code Playgroud)

不调用所有委托函数.但我确实在xib文件和代码中设置了委托

self.theWebView.delegate = self;
Run Code Online (Sandbox Code Playgroud)

我没有通过谷歌找到任何信息.谢谢您的帮助.

ear*_*ian 6

我将loadRequest方法移动到presentViewController的完成处理程序,它在iOS 5,6和7中工作:

[self presentViewController:gwvc animated:YES completion:^(void){
    [gwvc.wv loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.walkjogrun.net/about/eukanuba.html"]]];
}];
Run Code Online (Sandbox Code Playgroud)