viewController初始类集

时间:2014-09-25 11:51:16

标签: ios objective-c uiviewcontroller

我有两个视图控制器,默认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; 
}

0 个答案:

没有答案