views:

45

answers:

2

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

+2  A: 

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];
Aji
Thanks Aji i tried this before, it also crashed without any warning. Anyway it will be useful for my web service request,.. now i'm drawing this pdf file in drawing context
Karthik Kumar
A: 

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

Karthik Kumar