2012-03-13 41 views
1

我想爲我的遊戲設置排行榜,但我不知道要傳入GKScore:initWithCategory。在iTunes連接中有「排行榜參考名稱」和「排行榜ID」這兩個我已經嘗試,但分數仍然現在顯示在gamecenter中。GameKit排行榜GKScore initWithCategory - 要指定什麼「category」

在ITC中沒有提及「類別」,術語是否有變化?我傳遞給這個函數的是什麼?

回答

5

您需要通過的值在iTunes Connect排行榜部分中標記爲排行榜ID

更新: 我提交高分排行榜採用以下,其中一類是排行榜ID在iTunes Connect中指定的

GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"yourLeaderBoardId"] autorelease]; 
    scoreReporter.value = score; 

    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) 
    { 
     if (error != nil) 
     { 
      // handle the reporting error 
      NSLog(@"error reporting score"); 
     } 
    }]; 

而且,它似乎在沙箱中,除非兩個或更明顯的GameCenter賬戶已經提交了分數,沒有分數會顯示出來。