I have a UITabBarController that has 3 tabs. Each tab contains a UITableViewController. When I add a subview to one of the UITableView’s and then switch to another tab I get the error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<MessageTableViewController 0x703f6b0> setValue:forUndefinedKey:]: this class is not key
value coding-compliant for the key emptyView.'
emptyView is the subview that I added. I am not sure why the new view that is being switched to requires emptyView?
UPDATE:
I am adding to emptyView by:
[self.view addSubview:emptyView];
in my viewDidAppear method.
MessageTableViewController is the rootview for the tab I am navigating to.
I am also noticing that no matter which tab I navigate to, I get this error. emptyView is only in the NIB for 1 of my VC’s. Not all three. Each tab has its own unique VC.
Try checking to see if the class is set correctly in Interface Builder identity inspector.
You will then want to look under the custom class heading to see if that objects class is set correctly.