我建立一個自定義顯示的遊戲中心,其工作,但我得到一個警告,對於下面的代碼 -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