I spend quite a bit of time on this. I have added break on all exceptions but the app doesn't catch this particular exception. If I disable the break all excpetions, I get a somewhat more meaningful message (below) but still don't know which code is throwing this. I am new to iOS please help! I am using Xcode 4.3.2 I simply following a tutorial (multi view) from a book but I am stuck at this error. My project is attached.
2012-05-31 23:38:55.028 SwitchViewer[13738:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x686c360> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
I can send you the project or upload it if anyone can tell where to send or upload? Thanks! Update: code
The UIApplicationMain() where the exception is caught is here and I have not changed this from default. #import
#import "BIDAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([BIDAppDelegate class]));
I have some code here where I am setting up the root controller.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.switchViewController = [ [ BIDSwitchViewController alloc] initWithNibName:@"SwitchView" bundle:nil];
UIView * switchView = self.switchViewController.view;
CGRect switchViewFrame = switchView.frame;
switchViewFrame.origin.y += [UIApplication sharedApplication].statusBarFrame.size.height;
switchView.frame = switchViewFrame;
[self.window addSubview:switchView];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
Update: I have uploaded my project (zip) file, you can downloaded it from here, the file name is SwitchViewer.zip I would really appreciate if you can help me find what the error is since I need to learn how to resolve debug errors. Thanks.