【发布时间】:2014-06-24 19:13:53
【问题描述】:
您好,我创建了一个 NSMutablArray,并在 RootViewController 中向其中添加了 8 个对象。我在表格视图中显示数组。每当我单击具有特定名称的单元格时,我想将 URL 传递给当前属于另一个 DetailViewController 的 webview。
在该详细视图控制器中,必须显示相应的网页。
从评论中添加
我在 indexpath 的 didselect 行中编写了这段代码
CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);
UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
[webView setBackgroundColor:[UIColor whiteColor]];
NSString *urlAddress = @"h.com";;
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
[webView release];
我的数组名是listofitems,如何直接把我的数组调用到url地址中呢?
【问题讨论】:
标签: uitableview ios4 uiwebview