Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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 找不到使用GKMatchmakerViewController的玩家_Ios_Objective C_Game Center_Gkmatchmaker - Fatal编程技术网

Ios 找不到使用GKMatchmakerViewController的玩家

Ios 找不到使用GKMatchmakerViewController的玩家,ios,objective-c,game-center,gkmatchmaker,Ios,Objective C,Game Center,Gkmatchmaker,我正在尝试整合游戏中心以匹配玩家。我使用的是一个非常简单的函数: - (void)findOpponent { GKMatchRequest* request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc]

我正在尝试整合游戏中心以匹配玩家。我使用的是一个非常简单的函数:

 
- (void)findOpponent {
    GKMatchRequest* request = [[GKMatchRequest alloc] init];
    request.minPlayers = 2;
    request.maxPlayers = 2;
    GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc]
                                         initWithMatchRequest:request];
    mmvc.matchmakerDelegate = self;

    [[self viewController] presentViewController:mmvc animated:YES completion:nil];
}
我有回电话,从来没打过电话:


- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)theMatch {
    NSLog(@"he");
    [[self viewController] dismissViewControllerAnimated:NO completion:nil];
    GKMatch* match = theMatch;
    [match setDelegate:self];
    NSLog(@"Ready to start match!");
}

- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindPlayers:(NSArray *)playerIDs {
    NSLog(@"Super he");
}

- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didReceiveAcceptFromHostedPlayer:(NSString *)playerID {
    NSLog(@"Wow");
}
当我使用iOS 7.1在我的设备上测试iPhone或iPad时,我可以从我的应用程序中打开Game Center,但只要我点击Play Now,我立刻得到错误:找不到玩家。然而,我的代码中似乎没有任何回调被触发。知道我做错了什么吗?我确实尝试过重置我的iPad设置,从iCloud注销,重新启动我的设备等等。

修复

除了创建配置文件并在内部启用Game Center之外,您还需要在iTunes Connect上添加应用程序。
您需要进入一个非常奇怪的过程,它会询问您的应用程序的发布日期、价格、一些屏幕截图和图标,但一旦完成,您将能够真正启用Game Center。

您能在回答中提供更多详细信息吗?我有同样的问题,我把图标,截图,发布日期,定价等。。。但还是有问题。我需要一些帮助。我是否必须归档项目并将文件发送到iTunes connect?