iOS 应用程序更新问题与文档目录中的文件

发布于 2024-11-29 08:37:33 字数 329 浏览 7 评论 0原文

最奇怪的问题,我想看看以前是否有人遇到过这个问题。

我们有一个 iPad 应用程序,将 PDF 文件存储在文档目录中。一切都很顺利,我们可以整天用 CGPDFDocumentCreateWithURL 打开 PDF。然后,我们从同一临时站点重新安装应用程序,但由于某种原因无法加载文件。我们可以迭代文档文件夹,查看那里的文件,但无法打开它们。我们刚刚从 CGPDFDocumentCreateWithURL 得到一个 nil。

这感觉很像更新后文件的权限发生了变化,但无法证明这一点。

那么,有人遇到过这个帖子更新吗?是否有办法从 CGPDFDocumentCreateWithURL 返回错误?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

£烟消云散 2024-12-06 08:37:33

我们最近遇到了类似的问题,也许您也遇到了同样的问题。

您是否使用在更新应用程序之前(可能)保存的完整 URL/路径?

原因是 App_Home 目录在更新时发生变化。所以如果早些时候它是:
/var/mobile/applications//

更新后会变成
/var/mobile/applications//

解决方案是保存 App_Home 目录的相对路径。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文