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

Labeno

macrumors 6502
Original poster
Jul 21, 2008
351
1,089
Hi,

I want to view a PDF file that was added to the list of my app's resources.
I tried the following, but it did not work.

NSURL *url = [NSURL URLWithString:mad:"file:Users Guide.pdf"];
[[UIApplication sharedApplication] openURL:url];

Anyways suggestions?
 

Labeno

macrumors 6502
Original poster
Jul 21, 2008
351
1,089
Example of NSBundle

Your URL isn't correct. You will need to use NSBundle to get a full path to the resource and, quite possibly, escape characters that are illegal in URLs like spaces.

I've never used NSBundle. Could you provide an example of using it to get the path of a resource file? Thank you very much.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.