UIDocumentPickerViewController -> "No Documents" 因为 iCloud 不可用

UIDocumentPickerViewController -> "No Documents" because iCloud not available

我用这个方法来显示一个 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 显示得很好,但它总是显示

No Document, Documents in iCloud Drive are not available because the iCloud Documents & Data setting is disabled

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

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

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

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

中的空白 space