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