我的应用程序使用 uitabbarcontroller 和几个导航控制器。它在模拟器和真实设备上运行正常。然而,让我感到不安的是我在控制台中启动应用程序时收到的这条消息。Application windows are expected to have a root view controller at the end of application launch
我用谷歌搜索了它,但我找不到我的问题的答案。强制 appDelegate didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:FALSE forKey:@"loggedIn"];
[defaults setInteger:0 forKey:@"token"];
[defaults synchronize];
_window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"app_bg.png"]];
return YES;
}
我的 main.m 代码
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
如果有人可以帮助我,我会很高兴:) 谢谢!