Take the 2-minute tour ×

After some great trouble, I was finally able to load my first Navigation / ViewController, only now none of the sub items are clickable. I mean, I have a two text fields, two buttons, and a switch, but none of them do anything when clicked. I know it is not a problem with my xib file, as these elements behave in the xib simulator for iPad.

This is all the code my application uses so far, and I don't see why it should not be clickable.

MainWindow.xib = empty nib file

int retVal = UIApplicationMain(argc, argv, nil, @"iPadAppDelegate");

application: didFinishLaunchingWithOptions:

self.window = [[UIWindow alloc] init];

UIViewController *login = [[UIViewController alloc] initWithNibName:@"iPadLoginView" bundle:nil]; 

UINavigationController *nav_controller = [[UINavigationController alloc] initWithRootViewController:login];

self.window.rootViewController = nav_controller;
[self.window makeKeyAndVisible];

return YES;
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

replace your

self.window = [[UIWindow alloc] init];




self.window.rootViewController = nav_controller;


[self.window addSubview:nav_controller.view];
share|improve this answer
Thanks. I found something similar here: stackoverflow.com/questions/4373729/… window.screen = [UIScreen mainScreen]; is a little more compact –  user1122069 Mar 31 '12 at 18:39
Would you consider a kind up-vote for a poor soul –  Justin Amberson Mar 31 '12 at 18:40
add comment

Your Answer


