Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
uiwebview problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="sagarshivam" data-source="post: 1294472" data-attributes="member: 203583"><p>Dear All</p><p></p><p>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)</p><p></p><p>part of Maintable.m is:</p><p> </p><p>[CODE]</p><p>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {</p><p> detailViewController.detailItem = [file_list_for_subproject objectAtIndex:indexPath.row];</p><p> </p><p>}[/CODE] </p><p></p><p></p><p>detailviewcontroller.h is :</p><p></p><p>[CODE]</p><p></p><p>@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate> {</p><p> </p><p> UIPopoverController *popoverController;</p><p> UIToolbar *toolbar;</p><p> UIWebView *file_view;</p><p> id detailItem;</p><p> UILabel *detailDescriptionLabel;</p><p> IBOutlet UIImageView *imgview;</p><p>}</p><p></p><p>@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;</p><p></p><p>@property (nonatomic, retain) id detailItem;</p><p>@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel;</p><p>@property (nonatomic,retain) UIWebView *file_view;</p><p>@property (nonatomic ,retain) UIImageView *imgview;</p><p>@end</p><p>[/CODE]</p><p></p><p></p><p>and part of detailviewcontroller.m is:</p><p></p><p>[CODE]</p><p>- (void)setDetailItem:(id)newDetailItem {</p><p> if (detailItem != newDetailItem) {</p><p> [detailItem release];</p><p> detailItem = [newDetailItem retain];</p><p> NSString *fname1= [NSString stringWithFormat:@"%@",detailItem];</p><p> NSLog(@"file name passed is %@",fname1);</p><p> //fname is getting displayed properly</p><p> [self configureView];</p><p> </p><p> }</p><p></p><p> if (popoverController != nil) {</p><p> [popoverController dismissPopoverAnimated:YES];</p><p> } </p><p>}</p><p></p><p></p><p>- (void)configureView {</p><p> </p><p> detailDescriptionLabel.text = [detailItem description]; </p><p> //CGRect frame= [[UIScreen mainScreen] applicationFrame];</p><p> //UIWebView *webview = [[UIWebView alloc] initWithFrame:frame];</p><p> //self.file_view.backgroundColor = [UIColor redColor];</p><p> NSURL *urpath = [NSURL URLWithString:@"http://172.22.79.169/~spp/Cref.pdf"];</p><p> NSURLRequest *req = [NSURLRequest requestWithURL:urpath];</p><p> [self.file_view loadRequest:req];</p><p> [self.view addSubview:file_view];</p><p> [self.file_view release];</p><p>}</p><p></p><p>[/CODE]</p><p></p><p>But pdf is not getting displayed. Where am I making mistake?</p></blockquote><p></p>
[QUOTE="sagarshivam, post: 1294472, member: 203583"] 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: [CODE] - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { detailViewController.detailItem = [file_list_for_subproject objectAtIndex:indexPath.row]; }[/CODE] 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 [/CODE] 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]; } [/CODE] But pdf is not getting displayed. Where am I making mistake? [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
uiwebview problem
Top