Question

NSURL *pdfURL = [[NSBundle mainBundle] URLForResource:@"sampleLayout.pdf" withExtension:nil];

This above line warns NSBundle may not respond to -URLForResource:withExtension: and the app crashes while loading the PDF file from this URL path.

Was it helpful?

Solution

Why dont you try like this..?

NSString *urlPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"pdf"];
NSURL *url = [NSURL fileURLWithPath:urlPath];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[webViewOutlet loadRequest:urlRequest];

OTHER TIPS

NSURL *pdfPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"pdf"]];

i got working from this above line, i think this is alternative for ipad 3.2 from iphone 4.0 os

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top