我的控制台出错并崩溃了.
“Application windows are expected to have a root view controller at the end of application launch”
下面是我的一段代码,在输入返回YES行后会发生崩溃.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIImageView *defaultImage = [[UIImageView alloc] initWithImage:splashImage]; defaultImage.frame = defaultImageFrame; [self.window addSubview:defaultImage]; [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(login:) userInfo:nil repeats:NO]; [self.window setBackgroundColor:[UIColor clearColor]]; [self.window makeKeyAndVisible]; return YES; // here crash will happens } -(void)login:(id)sender { PreLoginViewController *appController = [[PreLoginViewController alloc] initWithNibName:nil bundle:nil]; if (_ChooseLogin.isStatus == 105) { flagrequired = @"1"; appController.serverDownFlag = @"1"; } appController.termsURL = _ChooseLogin.urlString; appController._ChooseLogin = _ChooseLogin; appController.rootNetworkAvailable = NO; appController.verionMsg = versionStr; [dft setBool:NO forKey:@"isNeedActivate"]; appController.isNeedActivate = NO; navigationController = [[UINavigationController alloc] initWithRootViewController:appController]; }
谁知道如何解决这个问题?它在iOS 8中运行良好,直到Xcode 6.3.