I'm new to Objective-C and iOS development. I can't get a local pdf file to display in UIWebView. I am setting up an array to hold the file names, then display them in the UIWebView. Any help would be appreciated!
From MasterViewController.m: (set array of pdf file names)
[mCommands addObject:[[NSDictionary alloc]
initWithObjectsAndKeys:@"Break",@"name",@"cmd_break.pdf",@"url",nil]];
[mCommands addObject:[[NSDictionary alloc]
initWithObjectsAndKeys:@"Close",@"name",@"cmd_close.pdf",@"url",nil]];
From DetailViewController.m: (display pdf file in UIWebView)
NSString *filename = [self.detailItem objectForKey:@"name"];
NSString *path = [[NSBundle mainBundle] pathForResource:filename ofType:@"pdf"];
NSURL *detailURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:detailURL];
[self.detailWebView loadRequest:request];
Project->My Target->Build Phases->Copy Bundle Resources. If your PDF is not there, drag it from your project into that box. #2: Please Log 'path' before you load the WevView, It could be that the file name is wrong.