We have a cocos2d racing game where the player is constantly holding the gas button pressed while racing. The player is usually also quickly pressing and releasing buttons on the other side of the screen. The game is played in landscape mode with your thumbs on the buttons. This works fine on all devices except the iPhone 5 where the gas sometimes is released by itself without any reason. We've confirmed this with many of our users.
When testing ourselves on iPhone 5 we see that somtimes we get a touchesCancelled event for all touches, even though a finger is still down on the gas button. It can take 15 minutes of play to reproduce this bug. We've done a number of checks to see what could cause this cancelled event but haven't found anything yet.
We've also created a minimal test case with the same button layout as our game but COULD NOT reproduce the bug there. This test did not use cocos2d though.
We've made sure that no UIGestureRecognizers are added to the UIView. We do a check each frame to see if any UIGestureRecognizers are present. We've also made sure that no screen rotations occur during play. No such events happen and autorotation is disabled.
We're using GameCenter and we do also have a UIWebView loaded in the background which is only shown when the the user clicks certain buttons in the menus. We do also use Appirater, Twitter and the Facebook SDK.
We're using cocos2d version 0.99.4, but we've inserted our code to test the touches in EAGLView so we're basically getting the touch events directly from iOS. We log all touch events in EAGLView and there we see the unwanted "touches cancelled" that seem to happen for no reason.
Does anybody else have the same kind of problem and do you have any suggestions of possible causes to look for?
Can this be a hardware / iOS problem that we need to work around?
We're currently investigating if any other UIView could be popping up and disappearing within one frame. Maybe it wouldn't be noticeable visually, but enough to cancels all events for the game's EAGLView.
Any suggestions/workarounds are welcome!