I set up a navigation controller as detail view of a split view controller (NewFeedsNavigationController is inherited from UINavigationController).
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
NewsFeedsNavigationController *newsFeedsNavigationController = [[NewsFeedsNavigationController alloc] initWithCategories];
splitViewController = [[UISplitViewController alloc] init];
masterViewController.splitViewController = splitViewController;
splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, newsFeedsNavigationController, nil];
splitViewController.delegate = newsFeedsNavigationController;
// Add the split view controller's view to the window and display.
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
return YES;
}
As a matter of fact the navigation controller works splendidly in the portrait orientation but kind of freaks out in landscape orientation. When navigating back in the hierarchy (towards the root view) I always have to tap twice per view. Upon the first tap, the visible view is popped from the stack and upon the second tap, the navigation bar turns. Usually, both happen at the same time. I have no idea what is going wrong.