您为scoreReporter设置的值是什么,以便在游戏中心排行榜中显示为正确的时间.您需要什么来隐藏在排行榜中正确显示的秒数.任何帮助将不胜感激.
这是我的代码:
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"BestTime"] autorelease];
scoreReporter.value = TotalSeconds * 10;
Run Code Online (Sandbox Code Playgroud) 我试图向float我的游戏中心排行榜提交两位小数长度,但是唯一允许提交的格式是int64_t.我使用默认的Apple报告分数方法:
- (void)reportScore:(int64_t)score forCategory:(NSString *)category {
GKScore *scoreReporter = [[GKScore alloc] initWithCategory:category];
scoreReporter.value = score;
[scoreReporter reportScoreWithCompletionHandler: ^(NSError *error) {
[self callDelegateOnMainThread: @selector(scoreReported:) withArg: NULL error: error];
}];
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用此方法为报表分数方法提供分数:
- (IBAction)increaseScore {
self.currentScore = self.currentScore + 1;
currentScoreLabel.text = [NSString stringWithFormat: @"%lld", self.currentScore];
NSLog(@"%lld", self.currentScore);
}
Run Code Online (Sandbox Code Playgroud)
请帮忙,我一直在谷歌上搜索疯狂,无法找到答案.