Multiple NSPredicate

后端 未结 3 444
情深已故
情深已故 2021-01-04 01:53

I\'m trying to prepare multiple search in my CoreData entity Recipes. There are parameters by which I would like to prepare fetch.

Recipes

3条回答
  •  抹茶落季
    2021-01-04 02:25

    use NSCompoundPredicate for your multiple predicates, you can refer NSCompoundPredicate Class Reference

    something like this:

    NSPredicate * andPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:predicate1,predicate2,predicate3,nil]];
    

提交回复
热议问题