UINavigationController as detail view of a UISplitViewController
- by user309305
Hi.
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 {
// Override point for customization after app launch
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 splendid 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. on the first tap the visible view is poped from the stack and on the second tap the navigation bar turns. usually both of this happens at the same time. i have no idea what is going wrong.