分类: iOS平台
2013-01-17 13:45:35
用xcode4.2生成的程序是可以在ios5.1和ios6上运行的,但是在ios5下黑屏:
报错信息为:
2013-01-16 19:03:55.969 HelloCoco2d[5934:c07] Applications are expected to have a root view controller at the end of application launch经查询原因是ios5.1以上默认使用RootViewController,而在ios5以下默认不使用RootViewController
需要在AppDelegate手动添加代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.rootViewController=[[RootViewController alloc]init];
self.window.rootViewController =self.rootViewController;
[self.window makeKeyAndVisible];
return YES;
}