Sean
Sean

Reputation: 1

CCMenuItem doesn't work (Xcode 7.3~)

I’m a Japanese game developer. I develop some games with cocos2d-x.

I’m confused by the following problem. So, if you any idea, please help me.

When tap the button put on a cocos2d-x layer, the button doesn’t work. If the button be tapped, the call-back function of the button doesn’t be called. I have found some workarounds of the problem. However, I have no idea why the problem occurs. And, I want the most suitable way, how to fix it.

The following are develop environment and mobile devices that the problem occurs.

■ Develop environment

■ Mobile devices

If mobile device's condition (iOS version etc.) is different, the problem may not occur.

And, the apps built by Xcode 7.2.1 or older version have no problem. it work normally. The problem doesn’t also occur with the apps built by Debug build mode.

I attach a sample code.

https://github.com/SeanIchikawa/SampleProject/tree/master/CCBTest

The button of the layer is made by ccbi (ccbi = cocos builder file). The call-back function is referenced to the button by "Selector" in the ccbi file.

■ About the sample Xcode project

If you any idea, please give me.

Thank you for reading my question.

Upvotes: 0

Views: 119

Answers (2)

jayatubi
jayatubi

Reputation: 2202

This issue only occur if you are targeting a 32-bit architecture device with -Os optimization.

Set the optimization to -O1 in your release build could walk around this issue for now.

Upvotes: 0

Enric Verdaguer
Enric Verdaguer

Reputation: 1

The only way I've found at the moment to work it around is to downgrade Xcode to 7.2.1, having exactly the same problem but with CCButton instead.

Older Xcode versions can be downloaded from here: https://developer.apple.com/downloads/

Upvotes: 0

Related Questions