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

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

Based on the data model below

\"dataModel\"

And based on user input I create a NSSet of managedObjects

5条回答
  •  爱一瞬间的悲伤
    2020-12-23 11:09

    This is the definite answer so far:

    [NSPredicate predicateWithFormat:@"SUBQUERY(entryTags, $tag, $tag IN %@).@count = %d", selectedTags, [selectedTags count]];
    

    B-E-A-U-T-I-F-U-L.

    Thanks to Dave DeLong.

提交回复
热议问题