gpt4 book ai didi

ios - 使用 UIDocumentPickerViewController 导入文档警告 "fileprovider plugin was invalidated"

转载 作者:搜寻专家 更新时间:2023-10-30 22:19:04 24 4
gpt4 key购买 nike

每当我通过 UIDocumentPickerViewController 导入文档时,我都会看到一条消息记录到控制台:

TestApp[66587:1550086] plugin com.apple.UIKit.fileprovider.default invalidated

这是否意味着我的代码有问题?或者这只是一个预期的警告?有没有办法抑制它?


@IBAction func attachFile(sender: UIButton) {
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.image"], inMode: .Import)
documentPicker.delegate = self
self.presentViewController(documentPicker, animated: true, completion: nil)
}

func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL) {
}

最佳答案

我正在使用 xcode 8.3.2 和 swift 3.0...这是我的代码...它运行良好..只需调用 openDocumentPicker() 我希望它对您有帮助

extension AddCaseStep3ViewController : UIDocumentMenuDelegate,UIDocumentPickerDelegate{
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
let url = url as URL

//this is the url of your doc you can send enjoy!!
}

@available(iOS 8.0, *)
public func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {

documentPicker.delegate = self
present(documentPicker, animated: true, completion: nil)

}

func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
//dismiss(animated: true, completion: nil)
}

func openDocumentPicker(){
//
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.content","public.data","kUTTypePDF"], in: .import)
documentPicker.delegate = self
documentPicker.modalPresentationStyle = .formSheet
self.present(documentPicker, animated: true, completion: nil)
}}

关于ios - 使用 UIDocumentPickerViewController 导入文档警告 "fileprovider plugin was invalidated",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30835540/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com