- (void) reportScore: (int64_t) score forLeaderboardID: (NSString*) identifier
{
GKScore *scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier: identifier];
scoreReporter.value = score;
scoreReporter.context = 0;
NSArray *scores = @[scoreReporter];
[GKLeaderboard reportScores:scores withCompletionHandler:^(NSError *error) {
//Do something interesting here.
}];
}
在上面的网站上,我使用了上面的代码(标题是 Reporting a score to Game Center (iOS 7)),但在 GKLeaderboard reportScores... 行上,我收到一条错误消息,指出没有这种方法。如何在不使用 GKScore 已弃用的 reportScoreWithCompletionHandlerMethod 的情况下解决此问题?