Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 无法在游戏中心接收好友邀请_Ios_Cocoa Touch_Game Center_Multiplayer - Fatal编程技术网

Ios 无法在游戏中心接收好友邀请

Ios 无法在游戏中心接收好友邀请,ios,cocoa-touch,game-center,multiplayer,Ios,Cocoa Touch,Game Center,Multiplayer,我正在通过游戏中心创建一个有2名玩家的多人实时游戏 我遵循Ray Wenderlich的游戏中心教程,尝试设置邀请朋友。我设置了回拨,就像苹果说的: if ([GKLocalPlayer localPlayer].isAuthenticated) { [GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite) {

我正在通过游戏中心创建一个有2名玩家的多人实时游戏

我遵循Ray Wenderlich的游戏中心教程,尝试设置邀请朋友。我设置了回拨,就像苹果说的:

    if ([GKLocalPlayer localPlayer].isAuthenticated) {
        [GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite) {
            NSLog(@"Received invite");
            self.pendingInvite = acceptedInvite;
            self.pendingPlayersToInvite = playersToInvite;
            [self inviteReceived];
        };
    } 
我甚至测试了块属性是否已实际设置。是的

在iOS7上,我有一个模拟器和一台iPhone5,现在都在沙箱里。我无法收到任何邀请(见截图)。我启用了通知中心,选中了“设置”中的“接受邀请”,但从未调用该块。不过,随机配对效果不错


通过借用别人的设备而不是使用模拟器来解决这个问题。

你绝对是对的!我用模拟器试了几个小时,但什么也没发生。