swift - 发现扩展时遇到的错误 : Error Domain=PlugInKit Code=13 "query cancelled"

标签 swift

我正在尝试显示或上传 UIImage,但出现此错误。

"errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}"

import UIKit

class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { 

// linked labels and UiButtons

@IBOutlet weak var ifix: UILabel!
@IBOutlet weak var UIImage: UIImageView!
let someImageView: UIImageView = {
    let theImageView = UIImageView()
    theImageView.translatesAutoresizingMaskIntoConstraints = false // call this property so the image is added to your view
    return theImageView
}()


@IBAction func UploadImage(_ sender: UIButton) {
    let myPickerController = UIImagePickerController()
    myPickerController.delegate = self;
    myPickerController.sourceType =  UIImagePickerController.SourceType.photoLibrary
    self.present(myPickerController, animated: true, completion: nil)

}
    @objc func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any])
    {
        let image_data = info[UIImagePickerController.InfoKey.originalImage] as? UIImage
        let imageData:Data = image_data!.pngData()!
        _ = imageData.base64EncodedString()
        self.dismiss(animated: true, completion: nil)
    }


@IBAction func UIShuffle(_ sender: UIButton) {
}


@IBAction func UIReset(_ sender: UIButton) {
}

override func viewDidLoad() {
    super.viewDidLoad()
    // additional setup after loading the view, typically from a nib.
    view.addSubview(someImageView) //This add it the view controller without constraints
    someImageViewConstraints() //This function is outside the viewDidLoad function that controls the constraints

}
//  `.isActive = true` after every constraint
func someImageViewConstraints() {
    someImageView.widthAnchor.constraint(equalToConstant: 180).isActive = true
    someImageView.heightAnchor.constraint(equalToConstant: 180).isActive = true
    someImageView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
    someImageView.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: 28).isActive = true


}

}

最佳答案

此消息是无害的。该消息来自操作系统,并且与操作系统相关,请密切注意与您的应用正在执行的任何操作相关的任何新发现的扩展。当显示打开的文件对话框时,我经常在 macOS 上看到它。在浏览文件时,操作系统会检查是否需要加载任何与文件相关的扩展名,以便向您显示一些内容。当用户按下“确定”或“取消”时,它会停止搜索扩展并将该消息吐出到控制台。我收集到 iOS 可能正在做类似的事情,可能与共享或其他与用户文件相关的事件有关。该消息并不表示您的应用程序中有错误。

关于swift - 发现扩展时遇到的错误 : Error Domain=PlugInKit Code=13 "query cancelled",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53075405/

相关文章:

Swift - 将 Int64 转换为 NSMutableArray 的 AnyObject

ios - 由于部署目标早于设备,着色器性能数据可能不可用

swift - 沙盒扩展创建失败 : client lacks entitlements? 路径:

swift - 如何编译给定文件夹中的任何 swift 文件?

swift - 在 ios 7(swift) 上使用dispatch_get_global_queue时会发生EXC_BAD_INSTRUCTION

json - Swift Try/Catch NSJSON序列化

ios - Swift - 如何在tableView顶部插入单元格保持偏移和滚动惯性

swift - 搜索字段和表格 View - 仅显示用户名大写的用户

swift - AVFoundation:如何实时将视频写入文件而不是使用 exportAsync?

swift - 如何在 Swift 中为 SCNGeometrySource 构建数据