UINavigationController as detail view of a UISplitViewController

Posted by user309305 on Stack Overflow See other posts from Stack Overflow or by user309305
Published on 2010-04-05T15:25:24Z Indexed on 2010/04/13 12:33 UTC
Read the original article Hit count: 796

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about ipad

Related posts about uisplitviewcontroller