我使用此方法来显示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) }
No Document,Documents in iCloud Drive are not available because the iCloud Documents & Data setting is disabled
但是当我检查iCloud状态时,iCloud Drive已启用! (我的应用程序甚至出现在那里的设置中,也启用了!)
这发生在模拟器和设备上(通过Apple TestFlight分发的预发布)
解决方法
由于UTI常量无效,可能导致此错误:
确保仔细检查传递给documentTypes参数的UTI.在这种情况下,请注意public.composite-content字符串中的空格