UIWebView不显示网址

时间:2011-05-27 13:37:20

标签: iphone url uiwebview

我使用以下代码加载UIWebView:

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

但什么都没有加载?我做错了什么?

请帮帮我

1 个答案:

答案 0 :(得分:0)

尝试此代码可能会有所帮助............

   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];