文章目录
  1. 1. 前言
  2. 2. 参考资料
  3. 3. 文档信息

前言


集合类

1
predicate = [NSPredicate predicateWithFormat:@"%K CONTAINS %@",@"CollectUsers", userId];

模型属性过滤

1
[dataModels filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"type != '0' && type != '1'"]]

或者

1
2
3
4
5
[dataModels filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id  _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
HTModel * model = (HTModel *)evaluatedObject;
NSPredicate * printPredicate = [NSPredicate predicateWithFormat:@"type == '2' || type == '3'"];
return [printPredicate evaluateWithObject:model];
}]];

参考资料


  • 文档信息


  • 版权声明:自由转载-保持署名-非商用-非衍生 ( CC BY-NC-ND 4.0 )
文章目录
  1. 1. 前言
  2. 2. 参考资料
  3. 3. 文档信息