Mixing stringWithFormat
and predicateWithFormat
is error-prone because the quoting
and escaping rules are different. This might work (untested!):
[NSPredicate predicateWithFormat:@"SUBQUERY(subcategories, $x, SUBQUERY($x.gyms, $y, ANY $y.programs.uid IN %@).@count > 0).@count > 0", activeProgramsUIDsArray];