Question

[NSPredicate predicateWithFormat:@"ANY (spaceVariableDomains.domain.name = %@ AND spaceVariableDomains.variable.val = %@)", ...];

I want to write something like above into NSPredicate, but it is unable to parse the format string. Is it possible somehow compound conditions after ANY? Do I need to use SUBQUERY?

Was it helpful?

Solution

Finally I used SUBQUERY approach, basically this expression helped me:

SUBQUERY(spaceVariableDomains, $x, $x.domain.name = 'xxx' and $x.variable.val = 'yyy').@count > 0 AND SUBQUERY(spaceVariableDomains, $x, $x.domain.name = 'zzz' and $x.variable.val = 'www').@count > 0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top