(
(
{
"id" = 4;
"title" = abc
},
{
"id" = 5;
"title" = xyz;
},
{
"id" = 7;
"title" = "pqr";
}
)
)
NSMutableArray
中的这些数据,我通过ID或标题获取此数据的时间我只得到标题abc如何获取NSMutableArray
我的代码是: -
for(int counter =0 ; counter < [tempData count];counter++)
{
NSMutableArray *tempData1 = [tempData objectAtIndex:counter];
NSString *str_title = [tempData1 objectAtIndex:counter][@"title"];
[nsm_temp addObject:str_title];
}
nsm_temp
是NSMutableArray
答案 0 :(得分:1)
假设tempData
是您可以执行的外部数组:
NSArray *tempData = ... // the outer array
NSArray *innerArray = tempData[0];
for (NSDictionary *dict in innerArray) {
NSString *title = dict[@"title"];
[nsm_temp addObject:title];
}