赞
踩
搭建平台测试的时候
出现这样的问题Application windows are expected to have a root view controller at the end of application launch
解决方法:
1.将
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
改为
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
return YES;
}
也可以自己添加一个rootView
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
YcanMainViewController *mainViewController = [[YcanMainViewController alloc] init];
UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:mainViewController];
self.window.rootViewController = nav;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。