有没有办法以编程方式拒绝 GameKit 中的回合制比赛?

发布于 2025-01-02 19:14:43 字数 248 浏览 4 评论 0原文

GKTurnBasedMatch 中,每个 GKTurnBasedParticipant 都有一个 status 属性。我想将此属性设置为 GKTurnBasedParticipantStatusDeclined ;但是,它是只读的。我怎样才能以编程方式做到这一点?

据我所知,这只能通过 GKTurnBasedMatchmakerViewController 或清除邀请通知来完成。

In a GKTurnBasedMatch, each GKTurnBasedParticipant has a status property. I would like to set this property to GKTurnBasedParticipantStatusDeclined; however, it is read-only. How can I programmatically do this?

To my knowledge, it can only be done from the GKTurnBasedMatchmakerViewController or by clearing an Invite notification.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

掩耳倾听 2025-01-09 19:14:43

在 iOS 6.0 中,我们有了新的 GKTurnBasedMatch 方法

- (void)declineInviteWithCompletionHandler:(void (^)(NSError *error))completionHandler

With iOS 6.0 we have new method of GKTurnBasedMatch

- (void)declineInviteWithCompletionHandler:(void (^)(NSError *error))completionHandler
一直在等你来 2025-01-09 19:14:43

据我所知,您必须使用 -[GKTurnBasedMatch (void)participantQuitInTurnWithOutcome:(GKTurnBasedMatchOutcome)matchOutcome nextParticipant:(GKTurnBasedParticipant *)nextPlayer matchData:(NSData *)matchData finishHandler:(void (^)(NSError *error))completionHandler ] 这样做

To my knowledge you have to use -[GKTurnBasedMatch (void)participantQuitInTurnWithOutcome:(GKTurnBasedMatchOutcome)matchOutcome nextParticipant:(GKTurnBasedParticipant *)nextPlayer matchData:(NSData *)matchData completionHandler:(void (^)(NSError *error))completionHandler] to do so

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文