我想用登录页面实现应用程序。
我有基于 UIViewController 和 xib 文件的单独授权页面,用户应该在加载应用程序时首先看到该页面,并且我在 MainStoryboard.storyboard 中有基于 UITabBarController 的主应用程序,用户应该在成功登录后重定向。
要使用我在 AppDelegate.m 中执行的登录页面启动应用程序
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
NewUserViewController *controller = [[NewUserViewController alloc] init];
self.window.rootViewController = controller;
[self.window makeKeyAndVisible];
登录成功后如何从 NewUserViewController 切换到 UITabBarController?
我尝试(在 NewUserViewController.m 中)
MainTabBarViewController *myViewController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:NULL] instantiateViewControllerWithIdentifier:@"MainTabBarViewController"];
[self.navigationController pushViewController:myViewController animated:YES];
如果你能提供这个应用程序的另一种结构,我会很高兴!
对不起我的英语。