只是将 textField 命名为“IBtextFieldName”,它已经挂接到 Xib 中并且适当的类被分配给文件的所有者,但继续获取
'NSUnknownKeyException', reason: '[<UIViewController 0x7fb9cc81acd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key IBtextFieldName
已经尝试过:
- 清理构建,
- 删除派生数据,
- 将 Xib 作为源代码打开并删除不需要的连接,
- 删除并重新创建 xib 和关联的 .swift 类文件,
- 删除并重新创建了不同名称的 UITextfield 和 outlet,
- 重新启动 Xcode
最佳答案
已解决:
是个愚蠢的错误
正在使用,
let myController : MyController = UIViewController(nibName: "MyController", bundle: NSBundle.mainBundle()) as MyController
代替
let myController : MyController = MyController(nibName: "MyController", bundle: NSBundle.mainBundle()) as MyController
关于ios - Xcode6 Beta6 : this class is not key value coding-compliant for the key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25606325/