我有一个应用程序,正在尝试向游戏中心提交分数。这是我的代码:
- (IBAction) submitScore{
NSString *show = [[NSString alloc] initWithFormat:@"Note: Scores may take some time to update"];
self.note.text = show;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Submitted"
message:@"Your score has been submitted to the Gamecenter leaderboard"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
array = [NSMutableArray arrayWithContentsOfFile:Path];
NSString *s = [[NSNumber numberWithInteger:[array count]] stringValue];
NSString *denom = [NSString stringWithFormat: @"%d", 15];;
double resultInNum;
double sdouble = [s doubleValue];
double denomdouble = [denom doubleValue];
resultInNum = sdouble/denomdouble * 100;
if(resultInNum > 0)
{
self.currentLeaderBoard = kLeaderboardID;
[self.gameCenterManager reportScore: resultInNum forCategory: self.currentLeaderBoard];
Submit.enabled = NO;
}
array = [NSMutableArray arrayWithContentsOfFile:Path];
[array writeToFile:Path atomically:YES];
NSLog(@"Count: %i", [array count]);
} 但是,当我尝试这样做时,它不会提交给排行榜。我在调试器中没有收到任何错误,并且它曾经可以工作,直到我添加了多个排行榜。这里有什么问题?