我建立一个自定义显示的游戏中心,其工作,但我得到一个警告,对于下面的代码 -GKScore性能警告
NSMutableArray *playerIDsArray = [[NSMutableArray alloc] init];
[highScores removeAllObjects];
for (GKScore *thisScore in scores)
{
NSMutableDictionary *thisEntry = [[NSMutableDictionary alloc] init];
NSString *playerID = [thisScore playerID];
[thisEntry setObject:playerID forKey:@"playerID"];
[playerIDsArray addObject:playerID];
[thisEntry setObject:[NSNumber numberWithInt:(int)[thisScore value]] forKey:@"value"];
[highScores setObject:thisEntry forKey:[NSString stringWithFormat:@"%i",[thisScore rank]]]; // warning here
[thisEntry release];
}
为[thisScore等级]警告说“法“ -rank'not found(返回类型默认为'id')“。但代码工作正常。我一定会错过一些东西...
任何帮助表示赞赏!
在GKScore
对不起 - 没有任何区别,仍然得到相同的警告 – SomaMan 2011-04-12 11:22:23
ok .. hmm ..等级不是一种方法..它的一个属性..所以是[[thisScore.rank] intValue] – xuanweng 2011-04-13 01:55:02