Class is not key value coding compliant

烂漫一生 提交于 2019-12-13 04:24:19

问题


I have a NavigationController, root view controller called "ViewController" and a second view controller called "SettingsViewController". I have a segue to the "SettingsViewController" from "ViewController" which worked until I tried to connect a UITextField called "usernameField" to the "SettingsViewController" by means of Reference Outlet. When I did I got the following error whenever I try to go to the SettingsViewController:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<_TtC6mayfly22SettingsViewController 0x15e72af0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key usernameField.'

When I googled the error, most people said that it was caused by a reference outlet that got deleted in code but not in storyboard, or something along those lines, however I have thoroughly checked and have tried remaking the text box numerous times. What could I be doing wrong that could be causing this error?


回答1:


Solve this problem by cleaning app and rebuilding it. Product > Clean or Shift + Command + K



来源:https://stackoverflow.com/questions/24580908/class-is-not-key-value-coding-compliant

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!