Load PPT Into WebView

Discussion in 'iOS Programming' started by newtoiphonesdk, Apr 17, 2012.

  1. newtoiphonesdk macrumors 6502a

    Joined:
    Jul 30, 2010
    #1
    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?
     
  2. cMacSW macrumors regular

    Joined:
    Mar 20, 2006
    #2
    This line is not returning what you think:

    NSString *path = [[NSBundle mainBundle] pathForResource:selectedCountry ofType:mad:"ppt"];
     

Share This Page