0

我如何从中获取所有值NSMutableDictionary,但仅用于key @"Column1"或如何获取键的索引行?我尝试[dict objectForKey: @"Column1"];,但我只得到最后的价值key (user3)

示例表:

Column1 --  Column2

user1   --  20
user2   --  30
user3   --  50
4

2 回答 2

0

我会使用快速枚举:

for (NSMutableDictionary *thisDict in array) {
    NSLog(@"Result for Column1 is %@", [thisDict objectForKey:@"Column1"]);
}
于 2013-03-04T20:03:14.790 回答
0

我解决了。

结果是

for (int i = 0; i < [array count]; i++){
   NSLog(@"Result for Column1 is %@", [[array objectAtIndex:i]objectForKey:@"Column1"]);
}
于 2013-03-04T19:59:19.400 回答