【问题标题】:UIDocumentPickerViewController -> "No Documents" because iCloud not availableUIDocumentPickerViewController -> “没有文档”,因为 iCloud 不可用
【发布时间】:2015-08-17 14:30:54
【问题描述】:

我使用这个方法来显示一个 UIDocumentPicker:

func showDocumentPicker(){    
  let docPicker = UIDocumentPickerViewController(documentTypes: ["public.composite-content "], inMode: UIDocumentPickerMode.Import)
  docPicker.delegate = self
  docPicker.modalPresentationStyle = UIModalPresentationStyle.FullScreen
  self.presentViewController(docPicker, animated: true, completion: nil)
}

UIDocumentPicker 显示得很好,但它总是显示

没有文档,iCloud Drive 中的文档不可用,因为 iCloud 文档和数据设置已禁用

但是当我检查 iCloud 状态时,iCloud Drive 已启用! (我的应用程序甚至出现在设置中,也已启用!)

这发生在模拟器和设备上(通过 Apple TestFlight 分发的 Prerelease)

【问题讨论】:

    标签: ios swift icloud uidocumentpickervc


    【解决方案1】:

    这个错误可能是由于无效的 UTI 常量引起的:

    确保仔细检查您传递给documentTypes 参数的UTI。在这种情况下,请注意public.composite-content 字符串中的空格

    【讨论】:

      猜你喜欢
      • 2014-12-05
      • 1970-01-01
      • 2015-03-04
      • 1970-01-01
      • 2023-03-08
      • 2016-02-16
      • 1970-01-01
      • 2016-01-07
      • 2014-09-01
      相关资源
      最近更新 更多