iosxcodetargetnsunknownkeyexception

˜this class is not key value coding-compliant for the key˜ when creating a new Target


I have a big base project for iOS done in Swift. Now I was trying to create different client version by creating a new Targets:

The base project runs just fine. But I get the following NSUnknownKeyException when I switch for the new target:

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

"textConfirmPassword" is a reference of a Text Field from my main.storyboard.

Before doing all this, I created a sample project using an image and a referenced label. The versioning worked just fine.


Solution

  • I found what was wrong. Something really simple that I can't believe it took me so long to figure out. The first view controller had a module selected (when it was not supposed to have any). For that reason, whenever I ran a different target it would not find the view's elements.