views:

1793

answers:

5

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 {    

    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.

A: 

Seems like they fixed this issue with the final release of the OS 3.2 SDK

+1  A: 

I was mistaken. the erroneous behavior persists in the latest release, but I found the solution for my case. You must not derive a custom UINavigationController subclass. It even says so in the view controller programmers guide. Following that restriction I was able to solve all my issues.

A: 

Hi i need a similar solution for my app. I need a UINavigationController in the detail view controller like settings app. Can you please tell how i can achieve this functionality.??

Narinder Bansal
exactly as shown in the code box above. just substitute the NewsFeedsNavigationController with another UINavigationController and you are good.
A: 

I have a made a sample project with the above discussion . Source code for the Sample project is at the follwoing link iPad SplitViewContoller with UINavigationController in MasterView Will do the similar with navigationContoller in Detailview and post the link here. I have attached a rapidshare link to the source code, is there a better way to attach code in this post. something link attaching a zip file??

Narinder Bansal
+1  A: 

Narinder, can you reupload your sample, please?

DrMickeyLauer