数组IndexoutOfBounds在收到json值之前?

时间:2015-08-13 11:13:54

标签: objective-c uitableview nsarray nsdictionary uicollectionviewcell

存储数组值:
   在收到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'

0 个答案:

没有答案