ios - 这段代码为什么不能运行出百度网页,哪里出错了
本文介绍了ios - 这段代码为什么不能运行出百度网页,哪里出错了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
{
UIWebView *webView;
}
-
(void)viewDidLoad {
[super viewDidLoad]; webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; NSURL *url = [NSURL URLWithString:@"http://www.baidu.com"]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; [webView setUserInteractionEnabled:YES]; [webView loadRequest:request]; [self.view addSubview: webView];
}
-
(void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.
}
@end
解决方案
找到答案了,ios的传输限制:
这篇关于ios - 这段代码为什么不能运行出百度网页,哪里出错了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文