Ios 分数值递减

Ios 分数值递减,ios,game-center,Ios,Game Center,当我尝试存储小于当前值的分数值时,它不会被存储。需要帮忙吗 GKScore *scoreReporter = [[GKScore alloc] initWithCategory:@"top_matcher"]; scoreReporter.value = currentScore - 10; [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) { NSLog(@"ERROR:%@ %lld %@", error,

当我尝试存储小于当前值的分数值时,它不会被存储。需要帮忙吗

GKScore *scoreReporter = [[GKScore alloc] initWithCategory:@"top_matcher"];
scoreReporter.value = currentScore - 10;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
  NSLog(@"ERROR:%@ %lld %@", error, score, scoreReporter);
}];

你不能减少分数(如果你的排行榜设置为第一名),一旦你发布它,它就在那里。

你不能减少分数(如果你的排行榜设置为第一名),一旦你发布它,它就在那里。

如果你想显示所有分数,你必须将分数提交类型设置为“最近的分数”在iTunes Connect上。这将向您的排行榜提交所有分数。在检索排行榜分数时,如果您需要该功能,您可以自己按“值递减”进行排序

[myLeaderboard loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) {
    NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey: @"value" ascending: NO];
    NSArray *sortedScores = [scores sortedArrayUsingDescriptors: @[descriptor]];        
    }];

如果要显示所有分数,必须在iTunes Connect上将分数提交类型设置为“最新分数”。这将向您的排行榜提交所有分数。在检索排行榜分数时,如果您需要该功能,您可以自己按“值递减”进行排序

[myLeaderboard loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) {
    NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey: @"value" ascending: NO];
    NSArray *sortedScores = [scores sortedArrayUsingDescriptors: @[descriptor]];        
    }];