问题描述
[GKMatchmaker sharedMatchmaker] .inviteHandler在iOS 7中已弃用,但GameKit指南仍然说要以这种方式进行设置。有谁知道我们应该用于iOS 7实时游戏邀请?有几个监听器类的新类/方法,但没有一个特别针对我所见过的。
[GKMatchmaker sharedMatchmaker].inviteHandler is deprecated in iOS 7, yet the GameKit guides still say to set it up that way. Does anyone know what we're supposed to be using for iOS 7 real time game invites? There are new classes / methods for several listener classes, but none address this specifically that I have seen.
'inviteHandler' is deprecated: first deprecated in iOS 7.0
推荐答案
看起来像是预期的替换是 GKInviteEventListener
协议。您可以在GKLocalPlayer.h中看到对它的引用; GKLocalPlayerListener
协议扩展了它。
It looks like the intended replacement is the GKInviteEventListener
protocol. You can see a reference to it in GKLocalPlayer.h; the GKLocalPlayerListener
protocol extends it.
但是,这个协议的文档有限(你可以在Xcode 5的文档窗口,但我没有在网上看到它。)
However, there's limited documentation on this protocol (you can search for it in the documentation window of Xcode 5, but I don't see it on the web).
鉴于缺少文档,现在继续使用已弃用的方法可能是最安全的。无论如何,你还需要继续使用iOS6。
Given the lack of documentation, it's probably safest to continue using the deprecated method for now. You'll need to continue using it anyway for iOS6.
这篇关于GameKit GKMatchMaker inviteHandler在iOS7中被弃用,有什么替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!