View Full Version : Viewing a PDF file
Labeno
Oct 17, 2008, 05:36 AM
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:@"file:Users Guide.pdf"];
[[UIApplication sharedApplication] openURL:url];
Anyways suggestions?
robbieduncan
Oct 17, 2008, 05:54 AM
Anyways suggestions?
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.
Labeno
Oct 17, 2008, 06:15 AM
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.
robbieduncan
Oct 17, 2008, 06:33 AM
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.
I'm not about to provide examples of the basics of Cocoa. It's in the documentation. I suggest you read it.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.