Touch dispatcher problem returning from Gamecenter [SOLVED - in a way!]

I am calling Gamecenter to show achievements in my game and all is fine, Gamecenter appears, you can click done and it returns to my game; All is fine except the multi-touch is not working correctly.

My “ccTouchesBegan(CCSet* touches, CCEvent* event)” is still being called but for only the first touch (before two or more touches would give a second/third touch).

I’ve tried calling “CCTouchDispatcher::sharedDispatcher()->removeDelegate(this);” followed by “CCTouchDispatcher::sharedDispatcher()->addStandardDelegate(this, 0);” but that doesn’t fix it.

This only happens with Gamecenter, exiting the app and returning as normal is fine.

Any ideas?

Also:

I have traced it back to EAGLView.mm and put a breakpoint on “- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event” there. Just the same it only gets one touch event even though I put two fingers on the screen (it was two before I visited Gamecenter).

OK, I sort of solved my own problem with a bit of googling. Fixed by removing Gamecenter from the superview! Has the undesired effect of killing Gamecenters animation out but at least I get back my multi-touch.

The old achievementViewControllerDidFinish

+ (void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController
{
    [g_myViewController dismissModalViewControllerAnimated:YES];
    [g_myViewController release];
}

becomes:

+ (void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController
{
    [g_myViewController dismissModalViewControllerAnimated:YES];
    [g_myViewController.view.superview removeFromSuperview];
    [g_myViewController release];
}

Got the clue from this Cocos2D thread: http://www.cocos2d-iphone.org/forum/topic/13750
P.S. The “[glView setMultipleTouchEnabled:YES];” doesn’t work.

-If anyone knows of a better way that doesn’t kill Gamecenters animation let me know, thanks!

Oh, a creating a timer to last 2 seconds that calls another function to kill the view is enough to let it animate out.