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?

Était-ce utile?

La 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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top