誰能告訴我如何從ÀppDelegate? I can start a
開始UINavigationContoller
rootViewContoller but cannot start a specific
UIViewController like I was trying in commented code. The commented code starts the **ChooseTableViewController** but does not display
UINavigationBar`。 什麼是更好的方法? 這裏是我的代碼從appDelegate啓動導航控制器
- (void)setRootViewController:(NSString *)storyBoardName {
//set the Root ViewController
UIStoryboard *story = [UIStoryboard storyboardWithName:storyBoardName
bundle:nil];
UINavigationController *newViewController =
[story instantiateInitialViewController];
self.window.rootViewController = newViewController;
/*
ChooseTableViewController *chooseTableViewController =
[story instantiateViewControllerWithIdentifier:@"ChooseTableViewController"];
self.window.rootViewController = chooseTableViewController;
*/
}
把'ChooseTableViewController'作爲'UINavigationController'的RootViewController的會爲你工作。 –