我想知道是否可以在沙盒应用程序上保留之前打开的文件或文件夹列表,而无需重新打开它们或复制到它自己的库中?
提前致谢
要跟踪用户访问的文件,您应该为每个文件创建安全书签,这样您的应用程序就可以在以后的应用程序运行时访问这些文件,而无需每次都获得许可。
我已经创建了这个类,它包含了您通过使用打开文件时已经拥有的持久权限NSOpenPanel
,然后您可以在将来使用该类访问该文件。
此时仅使用临时权利。
你应该使用类似的东西
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
<array>
<string>absolute path to use</string>
</array>
</dict>
</plist>
我希望 Apple 能够澄清如何在没有“临时”解决方案的情况下做到这一点,因为它破坏了许多应用程序