2
我想通过登录请求可视化一个UIViewController。 登录后(如果可以)我想显示我的应用程序,它由具有各种选项卡的UITabBarController组成。 现在,我通常是在AppDelegate中使用此代码来管理的UITabBarController:用于UITabBarController之前登录的UIViewController
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = @[viewController1, viewController2];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
,这将显示出我的应用程序。在此之前,如何显示一个用于登录请求的UIViewController?
嗨,谢谢你的回复....我已经用这种方式解决了...在正确的登录后,我将这段代码称为: homeViewController * controller = [[homeViewController alloc] initWithNibName:@“homeViewController”bundle:nil ]。 UITabBarController * tabBarController = [[UITabBarController alloc] init]; tabBarController.viewControllers = [NSArray arrayWithObjects:controller,nil]; tabBarController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:tabBarController animated:YES completion:nil]; – Blasco73 2013-02-16 13:43:48
太棒了,很高兴我能帮上忙。请不要忘记勾选复选标记。 – Mundi 2013-02-17 15:32:53