我知道这个主题已经启动了很多线程,但没有一个能解决这个问题。我一直在用使用 cocos2d v1.1.0-beta2b 的 kobold2d 创建一个游戏,自从我升级到 xcode 4.5 和 ios 6 之后,所有的方向都被抛弃了。通常 cocos2d 应用程序将以横向模式启动,但现在随着更新它以纵向模式启动并导致图层上的所有对象反转,但不知何故这已经修复了。所以现在我的项目在模拟器和 ios 设备上都以横向模式启动,但屏幕上的所有内容仍处于纵向模式。在我更新到最新软件之前,一切都运行良好。我能做些什么来解决这个问题?
所以我决定用旧的 xcode 4.4.1 构建我的项目,看看控制台中的输出与新的 xcode 4.5 有什么不同,这就是我发现的:
xcode 4.5 的输出
2012-09-21 14:50:54.558 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: OS version: 6.0 (0x06000000)
2012-09-21 14:50:54.560 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL_VENDOR: Apple Computer, Inc.
2012-09-21 14:50:54.560 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL_RENDERER: Apple Software Renderer
2012-09-21 14:50:54.560 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL_VERSION: OpenGL ES-CM 1.1 APPLE
2012-09-21 14:50:54.561 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2012-09-21 14:50:54.561 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2012-09-21 14:50:54.562 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL_MAX_SAMPLES: 4
2012-09-21 14:50:54.562 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL supports PVRTC: YES
2012-09-21 14:50:54.563 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL supports BGRA8888 textures: YES
2012-09-21 14:50:54.563 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL supports NPOT textures: YES
2012-09-21 14:50:54.563 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: GL supports discard_framebuffer: YES
2012-09-21 14:50:54.564 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: compiled with NPOT support: NO
2012-09-21 14:50:54.564 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: compiled with VBO support in TextureAtlas : YES
2012-09-21 14:50:54.564 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2012-09-21 14:50:54.565 KTireHoops-iOS[4539:c07] -[CCConfiguration init] : cocos2d: compiled with Profiling Support: NO
2012-09-21 14:50:54.565 KTireHoops-iOS[4539:c07] -[CCDirector init] : cocos2d: cocos2d v1.1.0-beta2b
2012-09-21 14:50:54.566 KTireHoops-iOS[4539:c07] -[CCDirector init] : cocos2d: Using Director Type:CCDirectorDisplayLink
2012-09-21 14:50:54.566 KTireHoops-iOS[4539:c07] -[KKAppDelegate applicationDidFinishLaunching:] : Kobold2D™ v1.1.2
2012-09-21 14:50:54.571 KTireHoops-iOS[4539:c07] Retina Display enabled: YES
2012-09-21 14:50:54.573 KTireHoops-iOS[4539:c07] -[ES1Renderer resizeFromLayer:] : cocos2d: surface size: 480x320
2012-09-21 14:50:54.579 KTireHoops-iOS[4539:c07] -[AppDelegate initializationComplete] : ARC is either not available or not enabled
2012-09-21 14:50:54.609 KTireHoops-iOS[4539:c07] -[CCDirectorDisplayLink startAnimation] : startAnimation
2012-09-21 14:50:54.610 KTireHoops-iOS[4539:c07] -[CCDirectorDisplayLink startAnimation] : cocos2d: Frame interval: 1
xcode 4.4.1 的输出
2012-09-21 14:52:01.343 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: OS version: 5.1 (0x05010000)
2012-09-21 14:52:01.345 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL_VENDOR: Apple Computer, Inc.
2012-09-21 14:52:01.345 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL_RENDERER: Apple Software Renderer
2012-09-21 14:52:01.346 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL_VERSION: OpenGL ES-CM 1.1 APPLE
2012-09-21 14:52:01.346 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2012-09-21 14:52:01.347 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2012-09-21 14:52:01.347 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL_MAX_SAMPLES: 4
2012-09-21 14:52:01.347 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL supports PVRTC: YES
2012-09-21 14:52:01.348 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL supports BGRA8888 textures: YES
2012-09-21 14:52:01.348 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL supports NPOT textures: YES
2012-09-21 14:52:01.350 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: GL supports discard_framebuffer: YES
2012-09-21 14:52:01.350 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: compiled with NPOT support: NO
2012-09-21 14:52:01.351 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: compiled with VBO support in TextureAtlas : YES
2012-09-21 14:52:01.351 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2012-09-21 14:52:01.351 KTireHoops-iOS[5207:c07] -[CCConfiguration init] : cocos2d: compiled with Profiling Support: NO
2012-09-21 14:52:01.352 KTireHoops-iOS[5207:c07] -[CCDirector init] : cocos2d: cocos2d v1.1.0-beta2b
2012-09-21 14:52:01.352 KTireHoops-iOS[5207:c07] -[CCDirector init] : cocos2d: Using Director Type:CCDirectorDisplayLink
2012-09-21 14:52:01.353 KTireHoops-iOS[5207:c07] -[KKAppDelegate applicationDidFinishLaunching:] : Kobold2D™ v1.1.2
2012-09-21 14:52:01.360 KTireHoops-iOS[5207:c07] Retina Display enabled: YES
2012-09-21 14:52:01.361 KTireHoops-iOS[5207:c07] -[KKRootViewController shouldAutorotateToInterfaceOrientation:] : shouldAutorotateToInterfaceOrientation
2012-09-21 14:52:01.361 KTireHoops-iOS[5207:c07] -[KKRootViewController shouldAutorotateToInterfaceOrientation:] : shouldAutorotateToInterfaceOrientation
2012-09-21 14:52:01.362 KTireHoops-iOS[5207:c07] -[KKRootViewController shouldAutorotateToInterfaceOrientation:] : shouldAutorotateToInterfaceOrientation
2012-09-21 14:52:01.362 KTireHoops-iOS[5207:c07] -[KKRootViewController shouldAutorotateToInterfaceOrientation:] : shouldAutorotateToInterfaceOrientation
2012-09-21 14:52:01.362 KTireHoops-iOS[5207:c07] -[KKRootViewController shouldAutorotateToInterfaceOrientation:] : shouldAutorotateToInterfaceOrientation
2012-09-21 14:52:01.363 KTireHoops-iOS[5207:c07] -[KKRootViewController shouldAutorotateToInterfaceOrientation:] : shouldAutorotateToInterfaceOrientation
2012-09-21 14:52:01.396 KTireHoops-iOS[5207:c07] -[AppDelegate initializationComplete] : ARC is either not available or not enabled
2012-09-21 14:52:01.436 KTireHoops-iOS[5207:c07] -[CCDirectorDisplayLink startAnimation] : startAnimation
2012-09-21 14:52:01.437 KTireHoops-iOS[5207:c07] -[CCDirectorDisplayLink startAnimation] : cocos2d: Frame interval: 1
2012-09-21 14:52:01.438 KTireHoops-iOS[5207:c07] -[KKRootViewController shouldAutorotateToInterfaceOrientation:] : shouldAutorotateToInterfaceOrientation
2012-09-21 14:52:01.439 KTireHoops-iOS[5207:c07] -[ES1Renderer resizeFromLayer:] : cocos2d: surface size: 320x480
从我所见, (shouldAutorotateToInterfaceOrientation) 方法不再在带有 ios 6 的新 xcode 中被调用。这导致了奇怪的方向错误。有谁知道解决这个问题。