How to use the “ALL” aggregate operation in a NSPredicate to filter a CoreData-based collection

后端 未结 5 2029
滥情空心
滥情空心 2020-12-23 10:39

Based on the data model below

\"dataModel\"

And based on user input I create a NSSet of managedObjects

5条回答
  •  Happy的楠姐
    2020-12-23 11:19

    The simplest way to do this:

    [NSPredicate predicateWithFormat:@"entryTags IN %@", selectedTags];
    

    You don't need the ALL clause. It's also documented here:

    Predicate Programming guide

    And as you can see in this post the user does it successfully (read the comments to the original question)

    NSPredicate iPhone 3.2 SDK Core Data “IN clause”...

提交回复
热议问题