Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Toreddo

macrumors member
Original poster
Jul 18, 2009
40
0
Hey everyone,

I was programming an iphone app when i realized my xcode version was kinda old. I upgraded to the iOS4 version now my application bugs immediately when it tries to start, without an error. I found the line in my application delegate where the crash may happen.

[window addSubview:navigationController.view];

If i comment the line, the app starts, without the navigationcontroller of course.

If i try to catch the exception it still crashes without a line in my log. :S
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
	@try {
	[window addSubview:navigationController.view];
	} 
@catch(id exception) {
		NSLog(@"D%@", exception);
	}
    [window makeKeyAndVisible];
	return YES;
}

I really can't see why it still crashes even if it is within a try, so i hope someone can help me out here.

Thanks Chris :)
 
Look at navigationController.view and see if it's been initialized or not. What does the debugger show? What does the crash report indicate?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.