昨天,我更新了Xcode到最新版本(5.1 (5B130a))
以兼容iOS 7.1
。然后我构建我的项目时,当选择64位模拟器(例如:iPhone Retina 4英寸64位)时,在EAGLView.mm
文件(第408行
)中出现错误"Cast from pointer to smaller type 'int' loses information"
。
我正在使用cocos2d-x-2.2.2
。在更新Xcode之前,我的项目仍然可以在所有设备上正常构建和运行。
感谢所有的建议。
更新:今天,我下载了最新版本的cocos2d-x(cocos2d-x 2.2.3)。但是问题仍然存在。
以下是出错代码的一部分:
/cocos2d-x-2.2.2/cocos2dx/platform/ios/EAGLView.mm:408:18: Cast from pointer to smaller type 'int' loses information
// Pass the touches to the superview
#pragma mark EAGLView - Touch Delegate
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if (isKeyboardShown_)
{
[self handleTouchesAfterKeyboardShow];
return;
}
int ids[IOS_MAX_TOUCHES_COUNT] = {0};
float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};
float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};
int i = 0;
for (UITouch *touch in touches) {
ids[i] = (int)touch; // error occur here
xs[i] = [touch locationInView: [touch view]].x * view.contentScaleFactor;;
ys[i] = [touch locationInView: [touch view]].y * view.contentScaleFactor;;
++i;
}
cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesBegin(i, ids, xs, ys);
}