【问题标题】:Error With Image Picker in Swift "this class is not key value coding-compliant for the key" [closed]Swift 中的图像选择器错误“此类不符合键的键值编码”[关闭]
【发布时间】:2016-05-30 09:20:17
【问题描述】:

尝试在 Swift 中创建图像选择器时,用户按下按钮并选择图像,我遇到了这个错误:

'NSUnknownKeyException', reason: '[<MemeGenerator.ViewController 0x7ff3805a6f10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key selectedImage.'

我的视图控制器类是here

知道有什么问题吗?如有需要,我可以提供更多文件。

【问题讨论】:

    标签: ios swift exception uiimagepickercontroller


    【解决方案1】:

    通常,该消息意味着您在 IB(Interface Builder)中的控件和代码中定义的 IBOutlet 之间连接了一个 IBOutlet 链接,然后删除了该插座。在运行时,当系统尝试挂接链接时,它会失败。

    在 IB 中查看视图控制器中的所有出口(以及 IBActions)并查找损坏的链接。

    【讨论】:

      猜你喜欢
      • 2019-06-23
      • 1970-01-01
      • 2017-12-23
      • 1970-01-01
      • 2016-09-10
      • 1970-01-01
      • 1970-01-01
      • 2017-11-29
      • 2017-10-15
      相关资源
      最近更新 更多