私は自分のアプリのGame Centerリーダーボードを作ろうとしています。私はAppleからの手順に従い、GKTapperのサンプルコードに従ってきましたが、Game Centerに表示するスコアは得られません。私はiTunes Connectでリーダーボードをセットアップしました。スコアを報告するコードは次のとおりです。sandbox leaderboard empty
- (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を実行しています。