iphone - How can I save pdf's to my app resources folder, and access them in run-time? -


I have an app that I'm designing that will allow many PDFs to be viewed. Many different languages ​​are available, and so if I want to include them all in the app, then it will be like 100+ MB size which will not fly anymore.

So I am thinking that I will keep the PDF on my server, and access them with a direct download link like this:

  http://mysite.com /pdfs/thepdf.pdf   

which I want will return the correct PDF. So I am wondering how can I go about reaching these resources because I download them on the fly?

Do I need to save PDFs in the App Resources folder? And then when a tableview row is selected for pdf, I check whether the PDF is in the resource folder (How do I do this?), And if not, then drag it down from the server and load it into my view?

I think what I need to do, that's fine, just to do this is not very clear on the code. Any code can be posted to the Resource Folders (if I really need to do), and how could possibly check whether some resources are in the folder or not?

Thank you!

Did you consider using a UIWebView to view PDF instead of downloading it and loading it is? UIWebView should take care of caching, so you will not have to worry about it.

Thinking that UIWebView will not work to download and view PDFs, if they exist, then you need to store it. Document Folder Change the resource folder after submitting your app in apple Can not go, but the documentation folder in your app is absolutely fine. To access it, I would really recommend ConciseKit, it gives you a helpful way to access your app's documentation directory. Supporting method

  is [$ documentPath];   

Then you can do the path to a file

  [[$ $ documentPath] stringByAppendingPathComponent: @ "file.pdf"];   

So in order to get the path to a file, to check if it exists, you want to use the NSF File Manager [[NSFileManager defaultManager] fileExistsAtPath: @ "From Top"];

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -