Search code examples
iosuinavigationcontrolleruisplitviewcontrolleripad

Making the Navigation controller in Detail view of Split View controller


How can we programmatically create a Navigation controller in Detailed view of Split view based iPAd App?

I tried the steps, provided in this link, but could not replace the Detail view controller with Navigation controller in XIB.


Solution

  • I know this is an old question, but i hate questions that aren't answered.

    UIViewController * masterController = ... allocation/init ...
    UIViewController * detailController = ... allocation/init ...
    UINavigationController *detailNavController = [[[UINavigationController alloc] initWithRootViewController:detailController ] autorelease];
    
    
    UISplitViewController *splitViewController = [[UISplitViewController alloc] init];
    splitViewController .viewControllers = [NSArray arrayWithObjects:masterController , detailNavController, nil];