UISplitViewController不显示我的DetailViewController

时间:2015-02-13 09:20:46

标签: ios objective-c uinavigationcontroller

我在Storyboard上使用过UISplitViewController,我已经为主视图和详细视图控制器设置了UINavigationController。已加载Master ViewController,但未加载Detail ViewController。

我无法弄清楚可能出现的问题?

你能帮我吗?

我在AppDelegate上的代码如下;

 if([Utils isIpad])
 {
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iPad" bundle:[NSBundle mainBundle]];

    UISplitViewController *splitViewController = [storyboard instantiateViewControllerWithIdentifier:@"splitViewController"];
    //UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
    UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"navigationViewControllerMaster"];
    splitViewController.delegate = (id)navigationController.topViewController;

    [self.window setRootViewController:navigationController];    
}

0 个答案:

没有答案