【发布时间】:2015-03-21 15:03:16
【问题描述】:
因此,在我的回合制 iOS 游戏中,当我单击“查找游戏”时,它会将我带到正确的视图控制器,而不是当前加入的游戏,例如因此,如果是 Naughts and Crosses,我会被带到游戏板上,但实际上不能轮到我,因为它把我带到了模板,而不是当前加入的游戏。我相信这是由于调试日志中的原因:
Attempt to present <GameViewController: 0x790cb030> on <ViewController: 0x790bfe80> which is waiting for a delayed presention of <GKTurnBasedMatchmakerViewController: 0x7a88de00> to complete
Warning: Attempt to dismiss from view controller <GameNavigationController: 0x790bfb20> while a presentation or dismiss is in progress!
第二行是当我尝试使用后退按钮时,它会将我带回主菜单,但随后会快速返回到 GameViewController。
我认为更改以下代码可以解决此问题,我只是不知道如何解决。任何帮助将不胜感激,谢谢!
- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController *)viewController didFindMatch:(GKTurnBasedMatch *)match
{
[presentingViewController dismissViewControllerAnimated:YES completion:nil];
[presentingViewController performSegueWithIdentifier:@"GamePlayScene" sender:match];
[self dismissModalViewController];
【问题讨论】:
标签: ios objective-c game-center modalviewcontroller