【发布时间】:2011-04-05 09:30:05
【问题描述】:
我有一个使用 Cocos2d(版本:#define COCOS2D_VERSION 0x00010000)的 iPhone 应用程序。它在我的 iPad 和 iPhone 以及我测试过的各种 iPhone 上都可以正常工作。
但是在一个(3G)上,它在初始化期间每次都会崩溃 - 崩溃日志在 CCSprite.m 文件中显示问题,在 -draw 方法中 - 在这一行中:
// tex coords
diff = offsetof( ccV3F_C4B_T2F, texCoords);
glTexCoordPointer(2, GL_FLOAT, kQuadSize, (void*)(offset + diff)); // This line crashes
崩溃日志显示如下:
OS Version: iPhone OS 4.2.1 (8C148)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000004
Crashed Thread: 0
Thread 0 Crashed:
0 MBXGLEngine 0x302554e8 0x30229000 + 181480
1 MBXGLEngine 0x30256980 0x30229000 + 186752
2 MBXGLEngine 0x3022ca80 0x30229000 + 14976
3 MBXGLEngine 0x30252580 0x30229000 + 169344
4 S100 0x000342d8 -[CCSprite draw] (CCSprite.m:606)
5 S100 0x00023e74 -[CCNode visit] (CCNode.m:550)
6 S100 0x00023e14 -[CCNode visit] (CCNode.m:535)
7 S100 0x00023e50 -[CCNode visit] (CCNode.m:545)
8 S100 0x00048500 -[CCDirectorIOS drawScene] (CCDirectorIOS.m:169)
9 Foundation 0x35168eda 0x35151000 + 98010
10 Foundation 0x35168d5e 0x35151000 + 97630
11 S100 0x0004ad38 -[EAGLView layoutSubviews] (EAGLView.m:214)
【问题讨论】:
-
我也有这个问题...你找到解决办法了吗?
-
当我从我的 App Delegate 中注释掉“删除闪烁”代码时,该问题似乎停止出现 - 一个带有缓冲区交换的代码。也许是这样?
标签: iphone cocoa-touch crash cocos2d-iphone