ios 谓词使用
//作用一
//创建谓词的对象 即判断条件对象predicate1
NSPredicate* predicate1 = [NSPredicate predicateWithFormat:@"name=='xiaonan'"];
if ([predicate1 evaluateWithObject:对象]) {
NSLog(@"zxc");
}
//作用二
NSArray* array = @[@"af",@"bg"];
NSArray* array2 = @[@"af",@"fsd",@"bg",@"tre"];
NSPredicate* thePredicate = [NSPredicate predicateWithFormat:@"NOT(SELF in %@)",array];
NSArray* arr3 = [array2 filteredArrayUsingPredicate:thePredicate];
NSLog(@"%@",arr3);
补充:移动开发 , IOS ,