The UIWebView doesn't display url

2019-08-27 13:50发布

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条回答
劳资没心,怎么记你
2楼-- · 2019-08-27 14:26

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];
查看更多
登录 后发表回答