gamecenterhelper.mからすべての一致を返すパブリックメソッドを作成しています
私はこれを持っています:
+(NSArray *)retrieveMatchesWithMatchData {
__block NSArray *myMatches = nil;
[GKTurnBasedMatch loadMatchesWithCompletionHandler:^(NSArray *matches, NSError *error) {
if (error) {
NSLog(@"There was an error loading matches");
}
else {
myMatches = matches;
}
}];
return myMatches;
}
しかし、アクティブな一致がある場合でも、これを呼び出すとnullが返されます。呼び出しメソッドは次のようになります。
NSLog(@"My matches: %@",[GameCenterHelper retrieveMatchesWithMatchData]);
御時間ありがとうございます!