Game center使用中的一些疑问

  • 本帖最后由 Long 于 2012-9-17 10:30 编辑 *

游戏要加入game center,但是我不会Obj-C,所以使用中有些问题,
//显示排行榜- (void) showLeaderboard{ if (!gameCenterAvailable) return;
GKLeaderboardViewController *leaderboardController = init]; if (leaderboardController != nil) { leaderboardController.leaderboardDelegate = self;
UIWindow *window = keyWindow]; currentModalViewController = init]; ; ; }
}这个方法怎么设置排行榜的id?

//上传一个分数

  • (void) reportScore: (int64_t) score forCategory: (NSString*) category
    {
    GKScore *scoreReporter = initWithCategory:category] autorelease];
    scoreReporter.value = score;

    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
    if (error != nil)
    {
    // handle the reporting error
    NSLog(@“上传分数出错.”);
    //If your application receives a network error, you should not discard the score.
    //Instead, store the score object and attempt to report the player’s process at
    //a later time.
    }else {
    NSLog(@“上传分数成功”);
    }

    }];
    }
    这个方法如何上传一个int类型的变量?如何调用这2个方法?