Dav*_*vid 4 objective-c gamekit ios game-center
我有一个有5种不同游戏模式的应用程序,其中3个有整数分数,其中2个有基于时间的分数(他们完成游戏的速度有多快).
如何设置我的reportScore:方法,以便我在iTunes Connect中设置的排行榜(以最低到最高时间格式显示高分数到百分之一秒)将以时间格式收到用户的分数?
我想把它作为一个发送NSTimeInterval.
Apple Docs指定的方法仅接受整数作为分数:
- (void) reportScore: (int64_t) score forCategory: (NSString*) category
{
GKScore *scoreReporter = [[GKScore alloc] initWithCategory:category];
scoreReporter.value = score;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
if (error != nil)
{
//handle the score to submit again later
}
}];
}
Run Code Online (Sandbox Code Playgroud)
UPDATE
我已经做了这方面的一些研究,我知道,你只能发送分数游戏中心排行榜作为int64_t.那么,如何格式化这个整数,使我的排行榜将其格式化为一个时间到百分之一秒?
谢谢你的帮助!
| 归档时间: |
|
| 查看次数: |
666 次 |
| 最近记录: |