我想在第一次应用程序启动其他明智的应用程序时启动登录屏幕,但问题是它再次进入登录屏幕。
这是我在 didFininsh 中使用的代码
我希望用户只第一次显示进入登录屏幕,下次它应该显示 splitViewController
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES],@"firstLaunch",nil]];
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 {
[self.window addSubview:[splitViewController view]];
}
// my comment[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
return YES;