-(void)sortWithManufacturerValue:(NSArray*)ValueArr
{
NSMutableArray *slicaArr = [[NSMutableArray alloc]init];
NSMutableArray *licoArr = [[NSMutableArray alloc]init];
NSMutableArray *keyLineArr = [[NSMutableArray alloc]init];
NSMutableArray *JMAArr = [[NSMutableArray alloc]init];
for (NSDictionary *dic in ValueArr) {
// NSLog(@"%@",model.manufacturer);
// if ([model.manufacturer isEqualToString:@"Silca"]) {
// [slicaArr addObject:model.manufacturer];
// } else if([model.manufacturer isEqualToString:@"ilco"]) {
// [licoArr addObject:model.manufacturer];
// } else if([model.manufacturer isEqualToString:@"keyline"]) {
// [keyLineArr addObject:model.manufacturer];
// }else{
// [JMAArr addObject:model.manufacturer];
// }
if ([dic[@"manufacturer"] isEqualToString:@"Silca"]) {
[slicaArr addObject:dic];
} else if([dic[@"manufacturer"] isEqualToString:@"ilco"]) {
[licoArr addObject:dic];
} else if([dic[@"manufacturer"] isEqualToString:@"keyline"]) {
[keyLineArr addObject:dic];
}else{
[JMAArr addObject:dic];
}
}
NSMutableArray *tarArr = [NSMutableArray arrayWithArray:slicaArr];
for (NSDictionary *dict in licoArr) {
[tarArr addObjectsFromArray: licoArr];
}
for (NSDictionary *dict in keyLineArr) {
[tarArr addObjectsFromArray: keyLineArr];
}
for (NSDictionary *dict in JMAArr) {
[tarArr addObjectsFromArray: JMAArr];
}
NSLog(@"%@",[tarArr[0] objectForKey:@"name"]);
NSLog(@"%@",[tarArr[0] objectForKey:@"manufacturer"]);
// NSLog(@"%@",[tarArr[0]);
}