私のiPadアプリでは、Webビューでデータを取得できません。その Web ビューは、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];
}