gpt4 book ai didi

iphone - iOS Development : When receiving a Game Center invite, 如何获取GKMatch对象?

转载 作者:可可西里 更新时间:2023-11-01 06:12:45 26 4
gpt4 key购买 nike

我正在构建一个使用 Game Center 的 iPhone 游戏,我很难理解如何开始一个比赛游戏,该比赛是通过收到 friend 的游戏邀请开始的。 docs说这个...

The acceptedInvite parameter is non-nil when the application receives an invitation directly from another player. In this situation, the other player’s application has already created the match request, so this copy of your application does not need to create one.

据此,我不需要创建匹配请求,因为发出邀请的玩家已经创建了一个。如果是这样,我如何获得向/从其他玩家发送/接收数据所需的 GKMatch 对象?我知道获取 GKMatch 对象的唯一方法是创建匹配请求并调用 findMatchForRequest 方法,文档说我不应该这样做。

他们为此提供的唯一代码示例涉及创建和使用 GKMatchmakerViewController,我无法使用它,因为我正在创建自己的自定义 View 。

非常感谢您的智慧!

最佳答案

我收到了一位 Apple 工程师的回复,他是这样说的......

You can do auto-matching with custom views, but there is no way to use invites without using GKMatchmakerViewController. So you should follow the code sample.

我想我的 UI 的一致性必须彻底打破。

关于iphone - iOS Development : When receiving a Game Center invite, 如何获取GKMatch对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4638046/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com