我有两个视图控制器,默认ViewController
以及我稍后为登录添加的视图:LoginViewController
。我将LoginViewController
设置为初始视图。但是,当我在LoginViewController
中的viewDidLoad之后运行应用时,它也会在-viewDidLoad
中触发ViewController
。
我有一个模态segue,登录成功后执行segue并显示ViewController,这是有效的。但是在执行app ViewController
时也会被解雇。有谁知道为什么会这样?的AppDelegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UIStoryboard *storyboard = self.window.rootViewController.storyboard;
UIViewController *rootViewController = [storyboard instantiateViewControllerWithIdentifier:@"LoginView"];
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}