我需要在基于item_type= bad
我试过但没有工作
NSPredicate *pred=[NSPredicate predicateWithFormat:@"(item_type == %@)", @"Good"];
NSArray *resultArray = [[dummyDictionary allValues] filteredArrayUsingPredicate:pred];
NSLog(@"resultArray:%@",resultArray);
{
“Cat1” = (
{
"image_item" = “a”;
"item_type" = “Good”;
}
);
Cat2 = (
{
"image_item" = “b”;
"item_type" = Good;
},
{
"image_item" = “c”;
"item_type" = Bad;
},
);
Cat3 = (
{
"image_item" = “d”;
"item_type" = Good;
},
{
"image_item" = “e”;
"item_type" = Bad;
},
);
}
需要输出NSMutableDictionary
{
“Cat1” = (
);
Cat2 = (
{
"image_item" = “c”;
"item_type" = Bad;
},
);
Cat3 = (
{
"image_item" = “e”;
"item_type" = Bad;
},
);
}
注意:dummyDictionary是我从.plist获得的值