Mercy Fang
Mercy Fang

Reputation: 1

NSUnknownKeyException error because of UIImageView and UITextField

I am getting NSUnknownKeyException error:

this class is not key value coding-compliant for the key" for this line of code: @IBOutlet weak var UsernameTextField: UITextField!.

However, I did check that there is no extra referencing outlet that is not needed.

Referencing outlet

Also this code only throws error if I connect the code with the UITextField in storyboard.

Upvotes: 0

Views: 48

Answers (1)

Jeffrey Bergier
Jeffrey Bergier

Reputation: 229

did you rename @IBOutlet weak var UsernameTextField: UITextField! to @IBOutlet weak var usernameTextField: UITextField! (lower case u) in your code file? That will cause this error. Its case sensitive.

Upvotes: 0

Related Questions