【问题标题】:UIDocumentPickerViewController: how to open a given subdirectoryUIDocumentPickerViewController:如何打开给定的子目录
【发布时间】:2015-07-16 07:43:22
【问题描述】:

我将 UIDocumentPickerViewController 与导入模式 (UIDocumentPickerModeImport) 一起使用,以便让用户从云存储提供商(Dropbox 等)导入文档。 每次用户重复导入过程时,他必须从其云存储的根目录开始浏览其文件夹层次结构。

有没有办法在给定的子目录上显示一个文档选择器?

我知道方法:

[NSURL bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:]   

但我无法将这些点与文档选择器演示选项联系起来。我希望选择器选项能够在给定的书签目录 url 上显示一个文档选择器。

【问题讨论】:

  • 目前的 API 无法做到这一点。您应该在 bugreport.apple.com 提交错误

标签: ios objective-c icloud-drive uidocumentpickervc uidocumentpickerviewcontroller


【解决方案1】:

你需要试试UIDocumentBrowserViewController

UIDocumentBroswerViewContoller 有方法 importDocument(at:nextToDocumentAt:mode:completionHandler:) 用于从本地和远程(如 Dropbox、iCloud 等)导入文档。

【讨论】:

    【解决方案2】:

    你需要用 url 初始化 UIDocumentPickerViewController。对于此操作,您可以(并且必须)使用initWithURL:inMode: 方法。就是这样:)

    猜你喜欢
    • 1970-01-01
    • 2016-08-17
    • 2017-04-21
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    • 2018-07-15
    • 2019-04-01
    • 2012-10-27
    相关资源
    最近更新 更多