0
在我的ipad应用程序中,我无法获取Web视图中的数据。该Web视图是splitviewcontroller的细节图。数据是从一个链接过来。无法在webview中的splitviewcontroller详细信息中获取数据
我使用这个代码。
在拆分视图表做选择行的索引路径
post=[self.postListMutableArray objectAtIndex:indexPath.row];
PostDetailsViewController *postDetails=[[PostDetailsViewController alloc]initWithNibName:@"PostDetailViewController_Ipad" bundle:nil];
postDetails.detailItem=post.postLink;
在拆分视图详细视图
- (void)setDetailItem:(id)newDetailItem
{
if (_detailItem != newDetailItem)
{
_detailItem = newDetailItem;
// Update the view.
NSLog(@"detail Item String is %@",_detailItem);
[self configureView];
}
}
- (void)configureView
{
// Update the user interface for the detail item.
NSString* str =_detailItem;
NSURL* url = [NSURL URLWithString:str];
NSLog(@"URL is ----> %@",url);
self.webView.scalesPageToFit=YES;
[self.webView loadRequest:[NSURLRequest requestWithURL:url]];
//[self.view addSubview:webView];
}
什么detailitem你setDetailItem方法和网址有你有在写在configureView日志。 – Girish