我有一个对象ID“分数”,我需要保存到我的排行榜。Cocos2d,需要将nsuserdefault对象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"];
而且有必要的,因为它是在同一个文件中没有玩家套件辅助基准。
我认为在开始尝试编写游戏之前,您需要花点时间来学习Objective-C和一般编程的基础知识。 – 2012-07-23 08:24:24