views:

125

answers:

1

Ok so I actually got to add UINavigationBar inside a UITabBarController using the following tutorial: http://twilloapp.blogspot.com/2009/03/how-to-embed-navigation-controller.html

But now the issue is that whenever I add a new button inside one of the views it just crashes.

For example:

In the first view called FirstViewController I added:

IBOutlet UIButton *test;

Than I also created:

- (IBAction) doSomething:(id)sender;

I hook up the test button with the UI in interface builder. But when I run i get:

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

Not sure what's going on with this.

Does anyone know of a solution?

Also, does anyone know where can I find good pre-built templates for these kinda apps so I can just start working rather than editing and setting things up.

Thanks

A: 

When you unarchive the nib file at runtime, it's going to invoke setTest:aButton on your controller, which will redirect to setValue:aButton forKey:@"test". Since it's throwing an exception that it doesn't know what the key @"test" means, chances are you forgot to put the @synthesize test; in your FirstViewController.m file.

Dave DeLong