Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
听起来这不可能,但我还是会问。
在我的应用程序中,我在文档目录中存储了很多图像和 plist。
我想在应用程序中实现一个 PDF 阅读器,允许用户通过 iTunes 将他们的 PDF 加载到应用程序中。我不希望用户能够查看/访问文档目录的内容,因为如果他们弄乱了这些文件,可能会导致应用程序意外执行。
这是可能的,还是可以将我的 plist 和图像放在其他地方?
您需要在 Apple 注册才能看到此内容,但此页面应为您提供所需的信息。
您需要将UIFileSharingEnabled密钥添加到Info.plist. 这将使用户可以访问应用程序的 Documents 目录,并允许他们删除或添加文件。
UIFileSharingEnabled
Info.plist
本教程提供了一个示例,说明如何在 iPad 应用程序中设置 PDF 支持。