0

我有 Loginview 控制器,我用 Xib 创建了它,我想在点击登录按钮时推送 mainstoryboard。

LoginViewController *lObjloginview = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
UINavigationController *lObjtempview = [[UINavigationController alloc] initWithRootViewController:lObjloginview];
self.window.rootViewController = lObjtempview;
[self.window makeKeyAndVisible];

这将从xib添加登录视图。但是在按下登录按钮后我想加载故事板。任何人都可以帮助我推动mainstoryboard,它在mainstoryboard中有标签栏控制器来链接xib。

4

1 回答 1

1

Load the initial view controller from the storyboard and present it

UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController * initialVC = [storyboard instantiateInitialViewController];
self.window.rootViewController = initialVC;

If you know a priori the class you're instantiating

UITabBarController * initialVC = (UITabBarController *)[storyboard instantiateInitialViewController];
于 2013-08-27T08:39:43.713 回答