Search code examples
iphonecocoacocoa-touchsubquerynspredicate

Quick Explanation of SUBQUERY in NSPredicate Expression


There appears to be zero documentation about the SUBQUERY keyword from Apple and I can't find a simple explanation about it on SO or on Google. It's a conspiracy! ;)

Please, could someone from the inner-circle please just provide a quick explanation of its syntax so I can use it?

SUBQUERY(Bs, $x, $x IN %@)

Thanks


Solution

  • This is what a subquery evaluates to. (Found from this mailing list thread, the #1 hit for “NSPredicate subquery” in Google.) That bit of documentation also explains how the predicate format string syntax relates to it.