Application windows are expected to have a root view controller at the end of application launch
这个问题在新版xcode和iOS6中出现,一些iOS5的经典著作的例子可能会有这种警告,解决的办法是添加一句 [self.window setRootViewController: rootController];很显然你的AppDelegate肯定需要一个rootViewController。下面是一个来自小橘子的例子。
参考例子:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
[[NSBundle mainBundle] loadNibNamed:@"TabBarController" owner:self options:nil];
[self.window setRootViewController: rootController];//fix the warning in ios6
[self.window addSubview:rootController.view];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}