- Joined
- Jun 3, 2011
- Messages
- 54
- Reaction score
- 0
- Points
- 6
Dear All
I am facing some problem with uiwebview. In my split view based application, on tapping cell of left panel (uitableview) , corresponding file (located on server) should be viewed on detail view (right pane of uisplitview)
part of Maintable.m is:
detailviewcontroller.h is :
and part of detailviewcontroller.m is:
But pdf is not getting displayed. Where am I making mistake?
I am facing some problem with uiwebview. In my split view based application, on tapping cell of left panel (uitableview) , corresponding file (located on server) should be viewed on detail view (right pane of uisplitview)
part of Maintable.m is:
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
detailViewController.detailItem = [file_list_for_subproject objectAtIndex:indexPath.row];
}
detailviewcontroller.h is :
Code:
@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate> {
UIPopoverController *popoverController;
UIToolbar *toolbar;
UIWebView *file_view;
id detailItem;
UILabel *detailDescriptionLabel;
IBOutlet UIImageView *imgview;
}
@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;
@property (nonatomic, retain) id detailItem;
@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel;
@property (nonatomic,retain) UIWebView *file_view;
@property (nonatomic ,retain) UIImageView *imgview;
@end
and part of detailviewcontroller.m is:
Code:
- (void)setDetailItem:(id)newDetailItem {
if (detailItem != newDetailItem) {
[detailItem release];
detailItem = [newDetailItem retain];
NSString *fname1= [NSString stringWithFormat:@"%@",detailItem];
NSLog(@"file name passed is %@",fname1);
//fname is getting displayed properly
[self configureView];
}
if (popoverController != nil) {
[popoverController dismissPopoverAnimated:YES];
}
}
- (void)configureView {
detailDescriptionLabel.text = [detailItem description];
//CGRect frame= [[UIScreen mainScreen] applicationFrame];
//UIWebView *webview = [[UIWebView alloc] initWithFrame:frame];
//self.file_view.backgroundColor = [UIColor redColor];
NSURL *urpath = [NSURL URLWithString:@"http://172.22.79.169/~spp/Cref.pdf"];
NSURLRequest *req = [NSURLRequest requestWithURL:urpath];
[self.file_view loadRequest:req];
[self.view addSubview:file_view];
[self.file_view release];
}
But pdf is not getting displayed. Where am I making mistake?