私の要件は、 UITabBarController が rootviewcontroller であり、アプリの初回起動時に UINavCon 内にあるログイン手順を表示したいということですpresentViewController
。
UITabBarController を初めて表示したくないし、ログイン UINavCon がモーダルとしてポップアップする方法も望んでいません。
初めてアプリを起動すると、ログイン UINavCon が表示されるユーザーエクスペリエンスを実現したいと考えています。だからここに私のコードがあります:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];//is it correct to call it here?
LoginVC *loginObj = [[LoginVC alloc]init];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:cellPhoneNumber];
self.tabBarController = [[UITabBarController alloc]init];
self.window.rootViewController = self.tabBarController;
[self.tabBarController presentViewController:self.navigationController animated:NO completion:^{}];
return YES;
}
[self.window makeKeyAndVisible];
の直後に 2 番目の回線で呼び出していuiwindow
alloc
init
ます。そうしないと、ビューコントローラーがイベントや向きの通知を受信しないなどの問題が発生する可能性がありますか?