首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >到代码的iOS UI连接

到代码的iOS UI连接
EN

Stack Overflow用户
提问于 2017-03-27 02:58:13
回答 1查看 347关注 0票数 2

每次我运行这段给Terminating app due to uncaught exception 'NSUnknownKeyException',setValue:forUndefinedKey:]: this class is not key value coding.'的代码,我所做的就是将button连接到label

代码语言:javascript
复制
class ViewController: UIViewController {

    @IBOutlet weak var lable: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func button(_ sender: Any) {
        lable.text="done"
    }

}

错误将被引用到class AppDelegate: UIResponder, UIApplicationDelegate

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-27 03:06:09

转到您的故事板,选择您的ViewController并转到本节

检查一下这里没有任何无效的出口。如果连接一个出口,然后通过代码更改变量的名称,那么xcode仍然会试图找到前一个接口,并会崩溃。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43037254

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档