我有一个使用故事板开发的ios5应用程序,当前在初始启动时显示标签栏控制器视图.我想在显示标签栏控制器之前显示登录屏幕.用户将输入他的用户名&密码,然后系统将对用户进行身份验证,如果成功,则显示标签栏控制器.
我试过以下3个选项但没有运气..任何想法?
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Option 1 UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; PointsViewController *firstVC = [[tabBarController viewControllers] objectAtIndex:0]; UIViewController *loginViewController = [[LoginViewController alloc] init]; [firstVC.navigationController pushViewController:loginViewController animated:YES]; // Option 2 UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UIViewController *loginViewController = [[LoginViewController alloc] init]; [tabBarController presentViewController:loginViewController animated:NO completion:nil]; // Option 3 UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UIViewController *loginViewController = [[LoginViewController alloc] init]; [tabBarController presentModalViewController:loginViewController animated:NO]; return YES; }