我想单独显示每个对象,仅针对此字典 (email,city,name):{"contact_search":{"0":{"email":"xxx","city":"xxx","name" :"xxx"}}}
问问题
49 次
1 回答
1
很难说你真正想要什么。
NSDictionary *contactSearch = [dictionary objectForKey:@"contact_search"];
[dictionary enumerateKeysAndObjectsUsingBlock:^(id key, NSDictionary *contact, BOOL *stop) {
NSString *name = [contact objectForKey:@"name"];
NSString *city = [contact objectForKey:@"city"];
NSString *email = [contact objectForKey:@"email"];
NSLog(@"name: %@, city: %@, email: %@", name, city, email);
}];
这将抓取对象字典,然后循环通过每个键/值对打印值
于 2012-07-25T11:03:52.253 回答