关闭后UIDocumentPickerViewController错误

时间:2018-05-02 09:39:22

标签: ios swift uidocumentpickerviewcontroller uidocumentbrowservc

我正在使用DocumentPickerViewController在我的应用中导入文档。选择器完成它的工作,没有错误,也没有崩溃,但每次拾取文档或视图控制器被取消后,我得到一个日志,出现以下错误:

[DocumentManager] The view service did terminate with error: 
Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" 
UserInfo={Terminated=disconnect method}

这是将呈现选择器VC的功能:

@IBAction func presentDocumentPicker(_ sender: Any) {
        let documentPicker = UIDocumentPickerViewController(documentTypes: ["com.adobe.pdf"], in: .import)
        documentPicker.delegate = self
        present(documentPicker, animated: false, completion: nil)
    }

这是代表扩展名:

extension ViewController: UIDocumentPickerDelegate {
    public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
        print(url)
    }
    public func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
        print("Canceled")
    }
}

我也尝试使用 UIDocumentBrowserViewController ,但我得到了相同的日志。我尝试的另一件事是启用iCloud权利,但没有任何变化。使用导航控制器,只需推送,DocumentPicker会呈现相同的结果。我所做的每一项测试都是在真实设备和模拟器上构建的。

我有什么不对的吗?无论如何我可以摆脱那个出现的日志吗?

0 个答案:

没有答案
相关问题