2012-06-05 58 views
1

我使用pushViewController導航到我的webview(在基於導航的應用程序中),並且我在我的webview中使用NSLog來檢查URL。事實證明,該網址已成功傳遞,但除了黑色背景之外,webview並沒有顯示任何內容。iOS UIWebView只顯示黑色背景

WebViewController *webView = [[WebViewController alloc] init]; 
    [webView setUrl:finalURL]; 
    [self.navigationController pushViewController:webView animated:YES]; 

在WebViewController.m ---- viewWillAppear中:

NSLog(@"%@", _url); // I got the url!!!!!!!!! 
    [webView loadRequest:[NSURLRequest requestWithURL:_url]]; 
+1

您是如何將網頁視圖添加到網頁視圖控制器的? – Kreiri

+0

嘗試添加'NSLog(@「%@」,self.view);'在viewWillAppear中:並查看它顯示的內容。 –

+0

另外** NSLog(@「%@」,webView); ** –

回答

0

你有沒有連接的Web視圖出口到webView?在.xib文件中

+0

我在我的故事板UIView之一中使用網絡視圖,所以它不起作用。最後,我製作一個新的xib並放入網頁視圖中,它可以工作。 – wyp