我正在使用 Game Kit API,我有一个非常简单的代码块,它永远不会返回,即使出现错误也不会......
GKLeaderboard *pointsRequest = [[GKLeaderboard alloc] initWithPlayerIDs:[match playerIDs]];
if (pointsRequest != nil)
{
//Set the points leaderboard category id
[pointsRequest setCategory:kPOINTS_LEADERBOARD_ID];
[pointsRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error)
{
if (error != nil) //THIS LINE NEVER GETS HIT
{
NSLog(@"%@", [error localizedDescription]);
}
if (scores != nil) //NOR DOES THIS LINE
{
.
.
.
由于没有错误,我不确定如何解决这个问题。有谁知道出了什么问题或我如何进一步调查出了什么问题?
非常感谢你的智慧!
更新:我终于能够让这段代码返回,但我不完全明白为什么。为了让它返回,我在尝试检索它之前不久在排行榜上发布了一个分数。奇怪的是我之前在那里发布过分数,所以我不知道为什么发布分数对这个问题有任何影响。