因此,我將分數發送給GC排行榜,我沒有收到任何錯誤,而且分數正常發送,但我仍然看不到排行榜中列出的分數!排行榜本身在Game Center中列出,沒有得分。iOS遊戲中心沙箱:排行榜顯示「沒有得分」
根據Google搜索和question on here這可以通過嘗試記錄多個帳戶的分數來解決。我現在已經在模擬器(iOS5)和我的iPhone上嘗試了三個不同的帳戶;提交評分時,他們都沒有顯示任何錯誤。
發送比分的代碼是在這裏:
- (void)reportScore:(NSString *)identifier score:(int)rawScore {
GKScore *score = [[[GKScore alloc] initWithCategory:identifier] autorelease];
score.value = rawScore;
[scoresToReport addObject:score];
[self save]; // Save here even though we save again in didEnterBackground, just in case of crash...
if (!gameCenterAvailable || !userAuthenticated) return;
[self sendScore:score];
}
- (void)sendScore:(GKScore *)score {
[score reportScoreWithCompletionHandler:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^(void)
{
if (error == NULL) {
NSLog(@"Successfully sent score!");
[scoresToReport removeObject:score];
} else {
NSLog(@"Score failed to send... will try again later. Reason: %@", error.localizedDescription);
}
});
}];
}