加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

swift – 发现扩展时遇到的错误:错误域= PlugInKit代码= 13“查

发布时间:2020-12-14 04:40:46 所属栏目:百科 来源:网络整理
导读:我试图显示或上传UI Image,我收到此错误. “errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 “query cancelled” UserInfo={NSLocalizedDescription=query cancelled}” import UIKitclass ViewController: UIViewContro
我试图显示或上传UI Image,我收到此错误.

“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可能正在做类似的事情,可能与共享或其他与用户文件相关的活动有关.该消息不表示您的应用程序中存在错误.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读