游戏中心资料表明,
playersToInvite
参数是当你的应用程序直接从游戏中心申办比赛推出非空。
有几个人问这是如何工作究竟,即似乎没有成为一个方式来选择从游戏中心应用的朋友,邀请他们从游戏中心玩; 当你在游戏中邀请它才会起作用。 在本文档日期或有开始从游戏中心游戏专用比赛以秘密的方式? 我想测试我的inviteHandler
但我一直无法确定这个参数是如何传递给应用程序。
[GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite)
{
// clean up games in progress here
if (acceptedInvite)
{
NSLog(@"acceptedInvite %@", acceptedInvite);
// The acceptedInvite parameter is non-nil when the application receives an
// invitation directly from another player.
GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithInvite:acceptedInvite] autorelease];
mmvc.matchmakerDelegate = self;
[self disableHomeUI];
[self presentModalViewController:mmvc animated:YES];
}
else if (playersToInvite)
{
NSLog(@"playersToInvite %@", playersToInvite);
// playersToInvite parameter is non-nil when your application is launched
// directly from the Game Center application to host a match
[self disableHomeUI];
[self doPresentMatchMakerUIWithPlayersToInvite:playersToInvite];
}
};