AppLuanches与翻转屏幕

时间:2013-07-17 05:16:55

标签: ios ipad app-launcher

我有应用程序,其中有LoginView我这样做如果用户第一次在应用程序中输入它将显示他登录屏幕它工作正常但问题是,当登录屏幕注释之前,眨眼间你看到了splitView控制器的主屏幕。

这是我的代码

   if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]) {

     [self.window addSubview:[splitViewController view]];
      LoginViewController *targetController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
    targetController.modalPresentationStyle = UIModalPresentationFullScreen;
     [self.splitViewController presentViewController:targetController animated:YES completion:nil];
     }

 else {

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    NSString*userNameM=[defaults objectForKey:@"userName"];
    NSString*userIDM=[defaults objectForKey:@"userID"];

    NSString*organizationCodeM=[defaults objectForKey:@"organizationCode"];

    userName=userNameM;
    userID=userIDM;

    organizationCode=organizationCodeM;

    [self.window addSubview:[splitViewController view]];
   }

0 个答案:

没有答案