2014-11-01 72 views
0

我做了一個應用程序,顯示寶萊塢新聞因爲我使UITableView和每個單元格包含Nes和每個單元格被選中,然後我想重定向到UIWebView與其鏈接。那麼如何才能通過URLUIWebView如何在iOS中的UIWebView中打開鏈接?

這裏我對didSelectRowAtIndexPath代碼:

我的代碼在這裏:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
NSDictionary *dict = [self.imagesa objectAtIndex:indexPath.section]; 
NSString *link=[dict valueForKey:@"link"]; 
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:link]]; 
} 

這裏所有的數據是從何而來JSON數據下面字典鍵值爲「鏈接」,並且每個環節每個包含細胞相對URLLink我想打開該鏈接到UIWebView。我爲那個UIWebView控制器,但不知道如何傳遞鏈接到UIWebView

它是如何是P ossible請給我解決方案。

回答

2
在WebViewController.m

現在

- (void) viewDidAppear:(BOOL) animated { 
    //URL Request Object 
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];   
    //Load the request in the UIWebView. 
    [webView loadRequest:requestObj]; 
} 
相關問題