In my MainWindow.xib, I have a the following structure:
-Files Owner
-First Responder
-MyApp App Delegate
-Window
-Tab Bar Controller
--Tab Bar
--Selected Recipes Nav Controller (recipes) - The class is set to a subclass of UINavigationController
--Other tabs…
I have details view for editing which contains tabs for each of the sections which can be edited, so the structure looks like this:
-Files Owner
-First Responder
-Tab Bar Controller
--Tab Bar
--Selected View Controller (recipes) - The class is set to a subclass of UINavigationController
---Scroll View
----UITextField (txtName)
----UITextField (txtDescription)
--Other tabs…
When the user clicks the add toolbar button on the main navigation controller, I want to push this new view onto the stack, but I get an exception:
* Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key txtName.'
I believe this could be caused by having two tab controllers. I've tried the following to show the new details view, but all throw the same exception:
MyAppAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
//[delegate.recipesNavController pushViewController:recipeDetailViewController animated:YES]; //- fails
//[delegate.rootController presentModalViewController:recipeDetailViewController animated:YES]; //- fails
[self presentModalViewController:recipeDetailViewController animated:YES]; //- also fails
EDIT: I'm not so sure now, as replacing it with a UISegmentedControl results in a similar error:
this class is not key value coding-compliant for the key generalScroller.'