Problem:
- I am getting a following error on Button click:
2014-06-05 13:19:28.118 Generic-Project[277:60b] Unknown class MySecondViewController in Interface Builder file.
2014-06-05 13:19:28.134 Generic-Project[277:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key lblStatus.'
Supporting comments:
lblStatus
is aUILabel
inside the new view controller which I am trying to open on button click. The custom class of the view controller is correct and the this label is only connected to the following property in the new view controller:@property (weak, nonatomic) IBOutlet UILabel *lblStatus;
Just a note, all the View Controllers including the root view controller is in a library that we've created. And the storyboard is in a different project. I've added the library reference to
Linked Framework and Libraries
option inGeneral
settings of the project in order to tell the project to use the library. Root view controller shows fine but when I click the button on it to open the second view controller, it gives the error.All works fine if either I move the second view controller from the library to the project or if I just add the .m file from the library to the
Compile Sources
inBuild Phases
of the project.
What I've tried:
I've tried the answers on following:
I'll appreciate your input. I am a beginner in iOS and have been trying to solve the puzzle since a day.