有一个数组,每个元素都是一个NSDictionary.
NSMutableArray *mutArr = [NSMutableArray array];
for (Person *person in persons) {
NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:person.name, @"name", person.email, @"email", nil];
[mutArr addObject:dict];
}
self.arr = [[NSArray alloc] initWithArray:mutArr];
Run Code Online (Sandbox Code Playgroud)
如何通过使用方法使用arr名称或电子邮件文件管理包含字符串.@"filter string"filterArrayUsingPredicate:
提前致谢!
我有一个NSPredication,格式如下:@"Status CONTAINS[cd] shipped"
我有一个字典数组,这是一个例子:
{
{
Category = "Category 4";
Comp = "Category 4";
Depth = 02;
Grade = New;
Length = 02;
Location = "Thousand Oaks, CA";
Name = "3ply Mat";
Owner = "Owner 3";
PUP = 2;
Status = Shipped;
"Unit Number" = 20110507113852351;
Width = 02;
},
{
Category = "Category 4";
Comp = "Category 4";
Depth = 02;
Grade = New;
Length = 02;
Location = "Thousand Oaks, CA";
Name = "3ply Mat";
Owner = …Run Code Online (Sandbox Code Playgroud)