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

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
Hello, could someone give me a hand? Have a TableView that loads individual ppt files from a folder called powerpoints. I am now trying to get those to display in a UIWebView in a different ViewController. In my TableView didSelectRow I have:
Code:
    NSString *selectedCountry = [self.files objectAtIndex:indexPath.row];
	Songs *dvController = [[Songs alloc] initWithNibName:@"Songs" bundle:[NSBundle mainBundle]];
	dvController.selectedCountry = selectedCountry;
	[self.navigationController pushViewController:dvController animated:YES];
	[dvController release];
	dvController = nil;
In my viewDidLoad of the other ViewController with the webView, I have:

Code:
 NSString *thetitle = [[selectedCountry lastPathComponent] stringByDeletingPathExtension];
    self.title = thetitle;
    NSString *path = [[NSBundle mainBundle] pathForResource:selectedCountry ofType:@"ppt"];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [savedweb loadRequest:request];
But this crashes with error:
Code:
-[NSURL initFileURLWithPath:]: nil string parameter'

Any ideas?
 
This line is not returning what you think:

NSString *path = [[NSBundle mainBundle] pathForResource:selectedCountry ofType:mad:"ppt"];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.