Ios 如何在NSPredicate中应用布尔运算?
我有以下搜索预测Ios 如何在NSPredicate中应用布尔运算?,ios,nspredicate,Ios,Nspredicate,我有以下搜索预测 NSPredicate *searchPredicateTextComponent = [NSPredicate predicateWithFormat:@"(SUBQUERY(entities, $x , ((ANY $x.objects.type LIKE 'text') AND ((ANY $x.objects.desc CONTAINS[c] %@) OR (ANY $x.objects.desc BEGINSWITH[c] %@)))).@count != 0)",
NSPredicate *searchPredicateTextComponent = [NSPredicate predicateWithFormat:@"(SUBQUERY(entities, $x , ((ANY $x.objects.type LIKE 'text') AND ((ANY $x.objects.desc CONTAINS[c] %@) OR (ANY $x.objects.desc BEGINSWITH[c] %@)))).@count != 0)", [NSString stringWithFormat:@" %@",subString],subString ];
现在我需要阻止没有布尔组合的对象为true,即:
i、 e.如果P=$x.isAllowed,S=$x.shouldByPass,则必须将布尔运算P的==TRUE添加到NSPredicate
这是可能的还是可行的 你的意思是把$x.isAllowed和$x.shouldByPass加到你的谓词中吗?是的。以及使用集合的实体进行的任何类型的布尔计算