iOS application update problem with files in documents directory
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 CG开发者_StackOverflow中文版PDFDocumentCreateWithURL?
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.
精彩评论