使用Game Center中新的rematchWithCompletionHandler方法时遇到问题 [英] Trouble Using the new rematchWithCompletionHandler method from Game Center

查看:46
本文介绍了使用Game Center中新的rematchWithCompletionHandler方法时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用gamecenter api制作回合制游戏.我想按一下按钮重新匹配玩家,这样他们就不必遍历Gamecenter视图控制器并重新邀请同一位玩家.在此问题中, iOS游戏工具包基于回合的比赛程序性重新比赛提问者稍后在ios 6.0上注意到,使用rematchWithCompletionHandler可以使此操作变得非常容易.我试图在游戏中使用它,并且只出现了未知的选择器错误或NSErrors,说我尝试创建的匹配项是不可能的.

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?

推荐答案

仅当两个玩家是Game Center的朋友时,它才对我有用.

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

这篇关于使用Game Center中新的rematchWithCompletionHandler方法时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆