1
私のアプリはスプラッシュ画面を表示します。メイン画面が表示されるのを待つようにするにはどうすればよいですか?待ち時間がなければ、アプリの起動直後にテストが失敗します。私のアプリはスプラッシュ画面を表示します。私のテストはメイン画面を待つことができますか?
// in application:didFinishLaunchingWithOptions: of my AppDelegate...
SplashViewController *splashVC = [[SplashViewController alloc] init];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = splashVC;
[self.window makeKeyAndVisible];
NSTimeInterval splashScreenDuration = 0.5;
[NSTimer scheduledTimerWithTimeInterval:splashScreenDuration
target:self
selector:@selector(hideSpashScreenAndDisplayMainViewController)
userInfo:nil
repeats:NO];
// hideSpashScreenAndDisplayMainViewController method simply sets self.window.rootViewController to the main view controller.
テストコードのスニペットを教えてください。 – khandpur