我有一个需要保存到排行榜的对象 ID“分数”。
我按照一个例子,到了这一部分
-(void) onPlayerInfoReceived:(NSArray*)players
{
CCLOG(@"onPlayerInfoReceived: %@", [players description]);
GameKitHelper* gkHelper = [GameKitHelper sharedGameKitHelper];
[gkHelper submitScore:1234 category:@"scoreboard"];
[gkHelper showLeaderboard];
}
除了我需要保存它。
_score = [[NSUserDefaults standardUserDefaults] integerForKey:@"score"];
并且不需要玩家工具包助手参考,因为它在同一个文件中。