Jason Zheng Jason Zheng - 2 years ago 65
Swift Question

App Unable to run after adding new custom view controller

This is the error message received in XCode:

2016-04-24 19:10:59.020 Bumble Bee[7286:421679] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Bumble_Bee.LoginController 0x7fc723db1ee0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key LoginTextField.'

The app was working fine until I added a new Swift file and defined a new custom view controller class named "LoginController".

Answer Source

Check for the missing outlet at Interface. In this case, you may have an wrong outlet reference at UIViewController's nib file like this. Open Interface builder, press right button to check outlets.

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download