0

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.

zar
  • 11,361
  • 14
  • 96
  • 178
  • just add the code of class where you are UIApplicate, i think its your app delegate. – rishi Jun 01 '12 at 04:53
  • the code is essentially from a book and it compiles but I get this exception. – zar Jun 01 '12 at 05:01
  • Try this -> http://stackoverflow.com/questions/10587266/double-free-set-a-breakpoint-in-malloc-error-break-to-debug-in-arc/10594274#10594274 – Naveen Thunga Jun 01 '12 at 05:44
  • @NaveenThunga I already have enabled break on all exceptions. – zar Jun 01 '12 at 13:11
  • Please check your xib connection. There might be some warnings.Some old value is retained in xib. Your issue is related to Xib only. – Naveen Thunga Jun 01 '12 at 13:15

1 Answers1

0

You probably did not connect the view in your SwitchView xib to the IBOutlet of your ViewController

iTukker
  • 2,083
  • 2
  • 16
  • 16
  • if you mean drawing connecting line from file owner to the view, I have already done that after I changed the file owner's class to SwitchViewController. – zar Jun 01 '12 at 05:31
  • Yes, thats what I mean, the main view in your xib should be connected to the view property (which you inherit from UIViewController) of your SwitchViewController – iTukker Jun 01 '12 at 05:35