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.
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.
I finally found the issue, for few view controllers in my storyboard->Identity Inspector->Inherit Module From Target wasn't selected that is why an error came in the newly created target.
Check "Inherit Module From Target" for view controllers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With