2012-01-18 60 views
3

我試圖在我的iPad遊戲中啓用遊戲中心排行榜,並且我已經瞭解到,您需要向排行榜發佈多個分數才能在默認排行榜UI中顯示分數。奇怪的遊戲中心行爲?

我有兩個separete帳戶,我曾經發布兩個不同的分數到同一個排行榜,但是當我打電話給loadScoresWithCompletionHandler時,我只得到一個分數(用戶當前登錄的分數)。

任何想法爲什麼?

GKLeaderboard *myLB = [[GKLeaderboard alloc] init]; 

myLB.category = @"MyLeaderboardId"; 
myLB.timeScope = GKLeaderboardTimeScopeAllTime; 
myLB.playerScope = GKLeaderboardPlayerScopeGlobal; 
myLB.range = NSMakeRange(1, 100); 

[myLB loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) { 
    if (error != nil) 
    { 
     NSLog(@"%@", [error localizedDescription]); 
    } 

    if (scores != nil) 
    { 
     for (GKScore *score in scores) 
     { 
      NSLog(@"%lld", score.value); 
     } 
    } 
}]; 

回答

0

它適用於我。只需在另一個帳戶下添加分數。

我有:

scores (
"<GKScore: 0x960e3e0><0x960e3e0> player=G:1208389607 rank=1 date=2012-01-19 12:56:47 +0000 value=27 formattedValue=27 context=(null)", 
"<GKScore: 0x96a1bc0><0x96a1bc0> player=G:1176161436 rank=2 date=2012-01-19 08:35:06 +0000 value=16 formattedValue=16 context=(null)" 

,並通過標準控制器顯示同樣的結果中心。

謝謝,