Cocos2d Version: v0.99.04
I am adding Game Center to my current application and I found the code to open the GKMatchmakerViewController. It seems that it works well, except when it deviates, it changes the orientation in the simulator to a portrait. The game only works in the landscape. I turn the device back to landscape and all cocos2d scenes still work fine, but if I open a warning or picketer, they will open in portrait mode. I can open and close scenes, but now they will show this behavior. This also happens using a real device.
// *.h UIViewController *tempVC; // *.m // Open GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease]; request.minPlayers = 2; request.maxPlayers = 2; GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease]; mmvc.matchmakerDelegate = self; tempVC=[[UIViewController alloc] init]; [[[CCDirector sharedDirector] openGLView] addSubview:tempVC.view]; [tempVC presentModalViewController: mmvc animated: YES]; // Close [tempVC dismissModalViewControllerAnimated:YES]; [tempVC.view removeFromSuperview]; [tempVC release];
As soon as I click rejectModalViewControllerAnimated, this will happen when the simulator rotates.
Thanks in advance for your help.
source share