The UIWebView doesn't display url

不羁岁月 提交于 2020-01-06 14:39:07

问题


I Load UIWebView using this code :

NSString *a=@"http://www.google.com/";
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:a]];
[aWebView loadRequest:theRequest];

But nothing is loaded? What I do wrong?

Please help me


回答1:


try This code may be helped............

   UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(50, 100, 690, 750)];
//webView.delegate=self;    
NSString *urlAddress = @"http://www.google.com/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];


来源:https://stackoverflow.com/questions/6153012/the-uiwebview-doesnt-display-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!