編集:私は、私はそれを使用する理由これは、睡眠を使用しているため、これをdownvoting 人物:AppDelegate「予期しないゼロ・ウィンドウ」というエラー
Making the launch image display longer xcode
ウィンドウサイズが小さく、そうでない場合。お答えしたい、それをdownvoteしないでください。 私はちょうどこのエラーを取り除きたい。
unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: UIClassicWindow: ; frame = (0 0; 320 568); userInteractionEnabled = NO; gestureRecognizers = NSArray: > ; layer = UIWindowLayer: >>
私は風景モードでiPadとiPhoneの両方で動作するiOSアプリを持っています。 iPadのシミュレータ上ではなく、iPhoneの5SとiPhoneの6Sに罰金それを実行します(私がこれまでテストしている)、私はこのエラーを取得する:
unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: UIClassicWindow: ; frame = (0 0; 320 568); userInteractionEnabled = NO; gestureRecognizers = NSArray: > ; layer = UIWindowLayer: >>
これはAppDelegateコードです..私は問題ありません。 ipadで。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// [NSThread sleepForTimeInterval:3];
[application setStatusBarHidden:YES];
self.window = [UIWindow new];
if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
self->_loginViewController = [[LoginViewController alloc] initWithNibName:@"somename~ipad" bundle:nil];
} else if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
self->_loginViewController = [[LoginViewController alloc] initWithNibName:@"somename~iphone" bundle:nil];
}
[[NSUserDefaults standardUserDefaults] setValue:@(NO) forKey:@"_UIConstraintBasedLayoutLogUnsatisfiable"];
self.window.rootViewController = nil;
self.window.rootViewController = self->_loginViewController;
[[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setTranslucent:NO];
[self.window makeKeyAndVisible];
[self.window setFrame:[[UIScreen mainScreen] bounds]];
return YES;
}
メインスレッド上で寝ないでください。 – rmaddy
これを参照してくださいhttp://stackoverflow.com/questions/25963101/unexpected-nil-window-in-uiapplicationhandleeventfromqueueevent –
@rmaddy私は打ち上げ画像を持っています。私はそれを3秒間表示したいので、それを置く。 – Swift