Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lafhog

macrumors newbie
Original poster
Aug 12, 2011
1
0
I am using plist to load the tableview, which works fine, then i have a directory of html files in resources, now i need to load each file when selected in tableView, into a webView which is in detailView,
any help would be greatly appreciated,
Code:
- (void)setDetailItem:(id)newDetailItem {
    if (detailItem != newDetailItem) {
        [detailItem release];
        detailItem = [newDetailItem retain];
      
        
        // Update the view.
        navigationBar.topItem.title = [detailItem description];
       
           }
    
    
    if (popoverController != nil) {
        [popoverController dismissPopoverAnimated:YES];
    } 
    
   }

- (void)viewDidLoad {
    [super viewDidLoad];
   
  
    NSString *urlAddress =[[NSBundle mainBundle] pathForResource:@"Cars" ofType:@"html"inDirectory:@"Cars"];
    NSURL *url = [NSURL URLWithString:urlAddress];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [webView loadRequest:requestObj];}
 
Last edited by a moderator:
To create NSURLs that point to files in the file system you need to use
Code:
[NSURL fileURLWithPath:path]
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.