Trouble Using the new rematchWithCompletionHandler method from Game Center

纵然是瞬间 提交于 2019-12-20 03:36:14

问题


I am making a turnbased game using the gamecenter api. I wanted to make a one press button to rematch players so they don't have to go through the gamecenter view controllers and re invite the same player. In this question iOS Game Kit Turn Based Match Programatic Rematch the asker notes later on that ios 6.0 makes this really easy using rematchWithCompletionHandler. I have tried to use this in my game and have only gotten unkown selector errors or NSErrors saying that the match I am trying to create is not possible.

[currentMatch rematchWithCompletionHandler:^(GKTurnBasedMatch *match, NSError *error)
         {
             if (error) {
                 NSLog(@"%@", error);
             }

             else
             {
                 currentMatch = match;
                 currentMatch.message = @"Rematch";
             }

         }];

Is there some stage that the match has to be in before calling rematch? or something I am missing?


回答1:


rematchWithCompletionHandler appears to only work when a match has been correctly ended by all players involved with the match.




回答2:


It only works for me when the two players are Game Center friends.



来源:https://stackoverflow.com/questions/13052638/trouble-using-the-new-rematchwithcompletionhandler-method-from-game-center

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!