gpt4 book ai didi

uiimagepickercontroller - 使用Swift 4-Xcode 9退出时出现Picker错误消息(在发现扩展时遇到:Error Domain = PlugInKit Code = 13)

转载 作者:行者123 更新时间:2023-12-03 11:55:20 26 4
gpt4 key购买 nike

如同

PhotoPicker discovery error: Error Domain=PlugInKit Code=13

还有

https://forums.developer.apple.com/thread/82105

但是我尝试了所有这些建议,但在调试日志中仍然出现错误。运行 Swift 4 XCode 9A235

在各个地方暗示的是...

  • 有人说添加@objc
  • 有人说添加内部
  • 有些人建议添加_并确保使用Any和not
    AnyObject
  • 有人说使用didFinishPickingImageWithInfo(此返回
    没有图片给我)
  • 有些人说挑剔选择器,其他人说解雇自己,其他人说
    说解雇两个
  • 有人说将'Privacy ...'添加到plist(完成)
  • 添加了导入照片
  • 添加了先前调用以强制PHPhotoLibrary.requestAuthorization(){
    (状态)->在...
  • 中无效

    我没有在Swift 3-以前的xcode中得到这个问题。
    但是使用Swift 4,我尝试了我看到的所有建议,但仍然收到以下错误

    [发现]在发现扩展程序时遇到的错误:错误域= PlugInKit代码= 13“查询已取消” UserInfo = {NSLocalizedDescription =查询已取消}

    选择器工作正常,我最终还是从照片中选择了图像,但是每次选择器退出(取消或选择)时,我都会收到此错误消息...

    有什么建议如何停止错误消息?除了在其他两个链接上提供的事物列表(以上概述)之外

    我的方法
    @objc internal func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {

    imageSelected = nil

    if let editedImage = info["UIImagePickerControllerEditedImage"] as? UIImage {
    imageSelected = editedImage
    } else if let originalImage = info["UIImagePickerControllerOriginalImage"] as? UIImage {
    imageSelected = originalImage
    }

    if imageSelected != nil {
    handleSelectedImage() // override in subclass to do something with the returned image
    }
    picker.dismiss(animated: true, completion: nil) // mess of calling both dismiss to see if it helps - it does not
    dismiss(animated: true, completion: nil)
    }

    最佳答案

  • 将'Privacy ...'添加到列表
  • 从Xcode菜单中打开:产品>方案>编辑方案>
    在环境变量上,将OS_ACTIVITY_MODE设置为值禁用

  • mc-system-group-container-and-mc-reading-from-public-effective-user-settings-err

    工作对我来说很好

    编辑

    如果可以在我的代码下面提供帮助(使用xcode 9)
    if libraryAuthorization == .authorized {
    let imagePicker = UIImagePickerController()
    imagePicker.delegate = self
    imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary
    imagePicker.allowsEditing = false
    imagePicker.view.tag = button.tag
    self.present(imagePicker, animated: true, completion: nil)
    }
    }

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
    if let pickerImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
    photoContainer.addImageToButton(pickerImage, buttonTag: picker.view.tag)
    dismiss(animated: true)
    }
    }

    关于uiimagepickercontroller - 使用Swift 4-Xcode 9退出时出现Picker错误消息(在发现扩展时遇到:Error Domain = PlugInKit Code = 13),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46608761/

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