タブバー ベースのアプリケーションで、スプラッシュ スクリーンを作成し、それをルート ビュー コントローラーとして設定しました。SplashViewController で、タブバー コントローラーを Windows の rootViewControoler として設定したいと考えています。
SplashViewController *splashViewController = [[SplashViewController alloc]initWithNibName:nil bundle:nil];
splashViewController.loginview = loginview;
self.window.rootViewController = splashViewController;
//SplashViewController
[NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(animationFinished) userInfo:nil repeats:nil];
-(void)animationFinished
{
Appdelegate *delegate = (AppDelegate*)([UIApplication sharedApplication].delegate);
delegate.window.rootViewController = delegate.tabBarController;
}
すべてのコードがエラーなしで実行され、アニメーション終了メソッドも呼び出されます。ただし、ウィンドウの rootViewController をタブバー コントローラーとして設定した後でも、スプラッシュ スクリーンは常に残り、ユーザーは tabBarController にリダイレクトされません。私が間違っていることは何ですか?