0

Oddest issue, thought I would see if anyone had run into this before.

We have an iPad application that stores PDF files in the documents directory. All goes great, we can open the PDF's with CGPDFDocumentCreateWithURL all day long. Then, we reinstall the application from the same adhoc site, and for some reason are not able to load the files. We can iterate the documents folder, see the files there, but can't open them. We just get a nil back from CGPDFDocumentCreateWithURL.

This feels very much like the permissions on the files change after the update, but can't prove that.

So, has anyone encountered this post update? Is there anyway to get a error return from CGPDFDocumentCreateWithURL?

Rob Bonner
  • 9,276
  • 8
  • 35
  • 55
  • I have a very similar app and the same problem! But my problem occurred when updating to iOS5! In my directory I have pdf documents and a XML file. The XML gets loaded but the pdf's not. I have to delete the app and reinstall it to get my pdf's back. Can you tell me how you solved it? – madmax Nov 05 '11 at 11:50

1 Answers1

3

We encountered a similar problem recently and perhaps the same is happening to you.

Are you using the complete URL/path which you had (probably) saved before you updated the application.

The reason is that the App_Home directory changes on updates. So if earlier it was: /var/mobile/applications/<guid1>/

after the update it will become /var/mobile/applications/<guid2>/

The solution is to save relative paths from App_Home directory.