IOS6 and iPhone 5 have been released for a while, so for cocos2dx in yesterday released the latest support of the Cocos2d-2.0-x-2.0.3 released version before running in iOS6 there will be two problems (Himi has been iphone5 real machine debugging verification and solve)
First, we provide a solution to the problem that libcurl. a cannot be compiled using armv7s:
The following is a solution for the abnormal horizontal screen of games in iOS6:
1. First, find the following code in the ios/AppController. mm class in the root directory of your project:
[Cpp]
// Set RootViewController to window
[Window addSubview: viewController. view];
Replace it with the following code:
[Cpp]
// Set RootViewController to window
If ([[UIDevice currentDevice]. systemVersion floatValue] <6.0)
{
// Warning: addSubView doesn' t work on iOS6
[Window addSubview: viewController. view];
}
Else
{
// Use this mehod on ios6
[Window setRootViewController: viewController];
}
2. Add the following functions to the ios/RootViewController. mm file in the root directory of your project:
[Cpp]
-(NSUInteger) supportedInterfaceOrientations {
Return UIInterfaceOrientationMaskLandscape;
}
-(BOOL) shouldAutorotate {
Return YES;
}
OK. Solve the problem.
The latest Cocos2d-2.0-x-2.0.3 released version, officially released yesterday, has addressed the above issues for iOS 6 and iPhone 5.
If there is a project error, check whether it is caused by a third-party SDK class library. After all, iOS6 updates bring updates to major third-party libraries.