我正在使用下面的代码来检查用户是登录还是注销,并且工作正常。但是因为我按名称获取情节提要,所以我总是将用户发送到 iPhone 的“输入”或“输出”视图控制器。如果我得到活跃的故事板,它会起作用。如何修复代码?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
BOOL user = ...;
NSString *segue = user ? @"in" : @"out";
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"iPhone" bundle:nil];
UIViewController *viewController = [storyBoard instantiateViewControllerWithIdentifier:segue];
[self.window setRootViewController:viewController];
return YES;
}