问题描述
我正在构建一款使用Game Center的iPhone游戏,我很难理解如何开始一场比赛游戏,该游戏是通过接收朋友的邀请来开始的。 说这个......
I'm building an iPhone game that uses Game Center and I'm having a hard time understanding how to start a match game that was started by receiving an invitation to play from a friend. The docs say this...
根据这个,我不需要创建匹配请求,因为进行邀请的玩家已经创建了一个匹配请求。如果是这样,我如何获得向/从其他播放器发送/接收数据所需的GKMatch对象?我知道获取GKMatch对象的唯一方法是创建匹配请求并调用 findMatchForRequest
方法,文档说我不应该这样做。
According to this, I don't need to create a match request since the player who did the inviting already created one. If so, how do I obtain the GKMatch object needed to send/receive data to/from the other player? The only way that I know to get the GKMatch object is to create a match request and call the findMatchForRequest
method, which the docs are saying I shouldn't do.
他们唯一的代码示例涉及创建和使用 GKMatchmakerViewController
,我不能使用它,因为我是创建我自己的自定义视图。
The only code example they have for this involves creating and using the GKMatchmakerViewController
, which I can't use since I'm creating my own custom views.
非常感谢您的智慧!
推荐答案
我收到了一位Apple工程师对此的回复,这是他说的......
I received a response from one of the Apple engineers on this, here's what he said...
我想这只是一致性的根本性突破我的用户界面。
I guess there's just going to have to be a radical break in the consistency of my UI.
这篇关于iOS开发:收到Game Center邀请时,如何获取GKMatch对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!