直接上方法:
- (NSArray *)filterArr:(NSArray *)arr1 andArr2:(NSArray *)arr2 {
NSPredicate * filterPredicate = [NSPredicate predicateWithFormat:@"NOT (SELF IN %@)",arr1];
//得到两个数组中不同的数据
NSArray * reslutFilteredArray = [arr2 filteredArrayUsingPredicate:filterPredicate];
if (reslutFilteredArray.count > 0) {
return reslutFilteredArray;
}
return nil;
}