我在应用程序商店中有一个小游戏,使用游戏套件的排行榜。代码来自Xcode文档。
- (void) reportScore: (int64_t) score forCategory: (NSString*) category {
if (!auth_ok)
return;
Class gcClass = (NSClassFromString(@"GKScore"));
GKScore *scoreReporter = [[[gcClass alloc] initWithCategory:category] autorelease];
scoreReporter.value = score;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
if (error != nil) {
NSLog(@"%@",error);
}
else {
NSLog(@"reportScore ok!");
}
}];
}
永远不会出错。但是今天我使用Xcode 3.2.5构建这个项目。并更改其他一些代码,我发现现在GKScore的报告得分是错误的。我将这样的reportScore消息称为:
int winCount=15;
[gameView reportScore:winCount forCategory:@"memory.iphone.wincount"];
,结果是值= 761228871165046176.like:
答案 0 :(得分:0)
它正好工作,自动化......