"Semantic Issue" with Xcode 5.1 and cocos2d-x-2.2.2

"Semantic Issue" with Xcode 5.1 and cocos2d-x-2.2.2
0.0 0


Hello everyone. After I updated my Xcode from 5.0.1 to 5.1, an issue never occurred before, just showed up.

usually after creating a new project, with create-project.py, a new Hello World project will be generated, no compiling or linking error.

But the following problems occurred after I updated my Xcode to 5.1.

Semantic Issue: 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];

    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;
    xs[i] = [touch locationInView: [touch view]].x * view.contentScaleFactor;;
    ys[i] = [touch locationInView: [touch view]].y * view.contentScaleFactor;;
    cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesBegin(i, ids, xs, ys);

Someone please tell me how to fix this issue, Thank you!!!

屏幕快照 2014-03-18 下午1.56.00.png (32.6 KB)

屏幕快照 2014-03-18 下午1.56.03.png (110.2 KB)


I solved this problem by editing EAGLView.mm, changing the “int” in “ids[i] = (int)touch;” to int64_t, a warning came out but the program can run. But changing the foundation code is not a good way I guess, so if anyone got any idea, please tell me, you’ve got my best regards!!!


v2.2.2 doesn’t support Xcode 5.1. Only v3.0rc0 supports it.


Thanks for telling!