目标:MAC催化剂的沙盒应用。我需要创建一个文件以在外部驱动器上编写数据。
据我了解,应该有某种对话框授予将数据写入App Sandbox之外的特定位置的权限。
我应该使用哪种对话?
通常,我遵循此过程:在应用程序文档目录中创建一个文件,然后使用 [uidocumentPickerviewController alloc] InitforeforexportingUrls
将此文件移动到沙盒外面。
但是现在,我需要创建一个用于在外部驱动器上写入的文件(在文档目录中无法创建文件,因为它将超过内部存储容量,但是外部驱动器足够大)。应该使用什么“保存文件对话框”?
Objective: a sandboxed application for Mac Catalyst. I need to create a file for writing data on external drive.
As far as I understand, there should be some kind of dialog which grants permission to write data to a specific location outside of the app sandbox.
What kind of dialog should I use?
Usually I followed this procedure: create a file in the app documents directory and then use [UIDocumentPickerViewController alloc] initForExportingURLs
to move this file outside of the sandbox.
But now I need to create a file for writing on external drive instead (file cannot be created in documents directory because it will exceed internal storage capacity, but external drive is big enough). What "save file dialog" should be used for that?
发布评论
评论(1)
好的,我找到了解决方案。
使用这种方法可以显示NSSAVEPANEL,并且所选文件具有书写所需的所有必要权限。
Ok, I found the solution.
Using this approach makes NSSavePanel to be displayed, and the chosen file has all necessary permissions for writing.