我正在嘗試爲我的應用製作一個Game Center排行榜。我一直在遵循Apple的步驟並遵循GKTapper的示例代碼,但我無法在Game Center中顯示任何分數。我已經在iTunes Connect中設置了排行榜。下面是報告得分的代碼:沙盒排行榜空
- (void) reportScore: (int64_t) score forCategory: (NSString *) category {
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:category] autorelease];
scoreReporter.value = score;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
if (error != nil)
{
UIAlertView* alert= [[[UIAlertView alloc] initWithTitle: @"Score Report Failed!" message: [NSString stringWithFormat: @"Reason: %@", [error localizedDescription]] delegate: self cancelButtonTitle: @"Try Again..." otherButtonTitles: NULL] autorelease];
[alert show];
}
}];
}
該代碼似乎運行良好。該警報從不顯示。但是,當我進入Game Center時,排行榜是空白的。我正在運行Xcode 4.2和iOS 5.任何想法?