In my ipad app i'm not able to get the data in a web view. That web view is in a detail view of splitviewcontroller. That data is coming from a link.
I'm using this code.
In split view table did select row at index path
post=[self.postListMutableArray objectAtIndex:indexPath.row];
PostDetailsViewController *postDetails=[[PostDetailsViewController alloc]initWithNibName:@"PostDetailViewController_Ipad" bundle:nil];
postDetails.detailItem=post.postLink;
In split view detail view
- (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];
}
create new Variable at PostDetailsViewController
.h class:-
@property(strong,nonatomic)NSString *strGetPostDetail;
and synthesize PostDetailsViewController
.m
@synthesize strGetPostDetail
Now you can call splitViewTable
Delegate
DidSelect
method:-
post=[self.postListMutableArray objectAtIndex:indexPath.row];
PostDetailsViewController *postDetails=[[PostDetailsViewController alloc]init];
postDetails.strGetPostDetail=post;