How to use NSPredicate with Key-Paths (and ALL)?

Posted by Konstantin on Stack Overflow See other posts from Stack Overflow or by Konstantin
Published on 2010-03-19T00:26:44Z Indexed on 2010/03/19 0:31 UTC
Read the original article Hit count: 245

Filed under:
|
|

Taking example from Apple docs using predicates with Key-Paths

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY employees.firstName like 'Matthew'"];

Now, assume the employees has a bool field "isGood". The question: how do I select just those entities, having ALL of employees isGood==TRUE?

I tried but failed with following predicates:

"!(ANY employees.isGood != TRUE)"
"(ALL employees.isGood == TRUE)" // Would be perfect, but throws an exception..

© Stack Overflow or respective owner

Related posts about predicate

Related posts about nspredicate