サンドボックスの更新に時間がかかっているか、コードがファンキーなのかどうかはわかりません。GK掲示板掲示の問題
私は単に最後にスコアを入力したローカルプレーヤーをつかんで別のスコアを追加し、結果を投稿しようとしています。任意の助け
- (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)
{
// handle the reporting error
NSLog(@"Error reporting score");
}
}];
}
-(void)postScore:(int64_t)score forCategory:(NSString *)category {
GKLeaderboard *query = [[GKLeaderboard alloc]init];
query.category = category;
if (query != nil)
{
[query loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) {
if (error != nil){
// Handle the error.
NSLog(@"Error loading scores");
}
if (scores != nil){
// Process the score.
int64_t newScore = query.localPlayerScore.value + score;
[self reportScore:newScore forCategory:category];
}
}];
}
[query release];
}
ありがとう:
は、ここに私のコードです。
EDIT:サンドボックスリーダーボードは最初のスコアを持ちますが、それ以降のスコアは更新されません。