【发布时间】:2011-07-30 18:45:48
【问题描述】:
我正在为 Game Center 构建一个自定义显示,它可以工作,但我收到以下代码的警告 -
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] 的警告显示“未找到方法 '-rank'(返回类型默认为 'id')”。但是,代码工作正常。我一定是错过了什么……
任何帮助表示赞赏!
【问题讨论】:
标签: iphone objective-c xcode warnings gamekit