Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.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
GKLocalPlayer LoadRecentPlayerWithCompletionHandler返回IOS10GM中最近玩家的空数组_Ios_Game Center_Ios10 - Fatal编程技术网

GKLocalPlayer LoadRecentPlayerWithCompletionHandler返回IOS10GM中最近玩家的空数组

GKLocalPlayer LoadRecentPlayerWithCompletionHandler返回IOS10GM中最近玩家的空数组,ios,game-center,ios10,Ios,Game Center,Ios10,我在iOS 10中制作了一个基于回合的多人游戏。 我使用ios10gm版本和Xcode 8gm版本 我尝试使用新方法获取最近玩家的列表: [player loadRecentPlayersWithCompletionHandler:^(NSArray<GKPlayer *> * _Nullable recentPlayers, NSError * _Nullable error) { if (error) NSLog(@"Error!"); else { NSLog(

我在iOS 10中制作了一个基于回合的多人游戏。 我使用ios10gm版本和Xcode 8gm版本

我尝试使用新方法获取最近玩家的列表:

[player loadRecentPlayersWithCompletionHandler:^(NSArray<GKPlayer *> * _Nullable recentPlayers, NSError * _Nullable error) {
if (error)
    NSLog(@"Error!");
else {
    NSLog(@"No error!");
    NSLog(@"recentPlayers count= %d", [recentPlayers count]);
}
}];
[player LoadRecentPlayerWithCompletionHandler:^(NSArray*\u可为空的RecentPlayer,NSError*\u可为空的错误){
如果(错误)
NSLog(@“错误!”);
否则{
NSLog(@“无错误!”);
NSLog(@“recentPlayers计数=%d”,[recentPlayers计数];
}
}];
我在本地播放器通过身份验证后立即调用该方法。 当我调用LoadRecentPlayerWithCompletionHandler时,我没有得到任何错误,只得到最近玩家的空数组

我看到了已完成游戏的列表,玩家最近在游戏中心应用程序(iOS 9)和GKTurnBasedMatchmakerViewController(iOS 10)中玩过这些游戏。 但在iOS 10中,LoadRecentPlayerWithCompletionHandler返回空数组 GKTurnBasedMatchmakerViewController中的“最近(玩家)”页面也为空

您是否将GKLocalPlayer.LoadRecentPlayers与CompletionHandler一起使用

如何获取iOS 10中最近的玩家列表