- (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.
}];
}
Run Code Online (Sandbox Code Playgroud)
在上面的网站上,我使用了上面的代码(标题是向游戏中心报告得分(iOS 7))但是在GKLeaderboard reportScores ...行上,我收到一条错误,说没有这样的方法.如何在不使用GKScore已弃用的reportScoreWithCompletionHandlerMethod的情况下解决此问题?
| 归档时间: |
|
| 查看次数: |
1808 次 |
| 最近记录: |