0
我是新來NSPredicate很抱歉,如果我問愚蠢的問題搜索的NSArray。我有兩個的NSArray(keyArray和valueArray)。我一直在使用keyArray找到匹配的valueArray。下面的代碼工作正常,但我要搜索一個接一個。任何方式使用不同的鍵陣列來搜索數組。使用NSPredicate
NSPredicate *userPredicate = [NSPredicate predicateWithFormat:@"companyId = %@", [[[self selectedCompanies] objectAtIndex:0] companiesIdentifier]];
NSLog(@"Users: %@", [[[self userData] users] filteredArrayUsingPredicate:userPredicate]);
NSPredicate *userPredicate1 = [NSPredicate predicateWithFormat:@"companyId = %@", [[[self selectedCompanies] objectAtIndex:1] companiesIdentifier]];
NSLog(@"Users: %@", [[[self userData] users] filteredArrayUsingPredicate:userPredicate1]);