iOS ---對json陣列的解析
阿新 • • 發佈:2019-01-31
小括號是陣列 大括號是字典
NSMutableArray *arr =[NSMutableArrayarray];
NSMutableArray *arr1 =[NSMutableArrayarray];
for (NSMutableDictionary *dictin 獲取的資料) {
NSString *str1 = [dict objectForKey:@"bname"];
NSString *str2 = [dict objectForKey:@"aid"];
[arr addObject
[arr1 addObject:str2];
}
NSLog(@" ------------------ ");
NSLog(@" arr元素 %@ ",arr);
NSLog(@" arr元素 %@ ",arr1);
NSLog(@" arr個數 %lu ",arr.count);
NSLog(@" arr1個數 %lu ",arr1.count);