存储数组值:
在收到json值之前显示错误
for (DicEtc in ArrCategory){
CatDescription=[[DicCategory objectForKey:@"cat_description"] length ]!=0 ? [DicCategory objectForKey:@"cat_description"]:@"" ;
[DicSeparation setObject:CatDescription forKey:@"cat_description"];
[DicSeparation setObject:[[DicCategory objectForKey:@"name"] length ]!=0 ? [DicCategory objectForKey:@"name"]:@"" forKey:@"name"];
[ArrName addObject:DicSeparation];
}
将数组显示到tableview标签:
cell.lbl_cell.text=[NSString stringWithFormat:@"%@",[[ArrName objectAtIndex:indexPath.row]objectForKey:@"cat_description"]];
输出:
-[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'