标签: gkscore

游戏中心格式化时间

您为scoreReporter设置的值是什么,以便在游戏中心排行榜中显示为正确的时间.您需要什么来隐藏在排行榜中正确显示的秒数.任何帮助将不胜感激.

这是我的代码:

GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"BestTime"] autorelease];
scoreReporter.value = TotalSeconds * 10;
Run Code Online (Sandbox Code Playgroud)

ios game-center gkscore

6
推荐指数
1
解决办法
1657
查看次数

iOS Game Center提交float而不是int64_t

我试图向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)

请帮忙,我一直在谷歌上搜索疯狂,无法找到答案.

objective-c gamekit ios game-center gkscore

1
推荐指数
1
解决办法
3546
查看次数

标签 统计

game-center ×2

gkscore ×2

ios ×2

gamekit ×1

objective-c ×1