我正在开发基于回合制的比赛应用 Wordiamo。它通过游戏中心联网。我在通过 GKTurnBasedMatchmakerViewController 邀请新玩家时遇到问题。我部署它:
let request = GKMatchRequest()
request.minPlayers = 2
request.maxPlayers = 2
let mmvc = GKTurnBasedMatchmakerViewController(matchRequest: request)
mmvc.turnBasedMatchmakerDelegate = self
mmvc.showExistingMatches = false
self.delegate = delegate
self.presentingViewController.present(mmvc, animated: true, completion: block)
启动视图控制器后,当我按下邀请朋友时,有时它可以正常工作(可能 30-50% 的时间),显示消息邀请。但很多时候它返回以下错误:
Error Domain=ExtensionErrorDomain Code=-5900 "(null)": 操作无法完成。(ExtensionErrorDomain 错误 -5900。) 2017-11-13 17:53:10.616581-0800 Wordiamo[7733:1484145] viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
有什么想法可能导致这种失败,这种失败只会在某些时候发生?谢谢。