0

I have the following code:

let pred = NSPredicate(format: "content IN %@ AND (tallied == 0 OR comment != '')", arr)
let query = CKQuery(recordType: "Rating", predicate: pred)

Which throws Terminating app due to uncaught exception 'CKException', reason: 'Unexpected expression: tallied == 0 OR comment != ""'

But when I try

"content IN %@ AND (tallied == 0)"

it works fine, same with

"content IN %@ AND (comment != '')"

But I need to be able to query all records that have tallied == 0 OR comment != ''. How do I structure this?

  • 1
    According to the CKQuery documentation, OR is not one of the allowed predicate operators. I think you'll need to do two separate queries, and combine the results. – rdelmar May 10 '15 at 04:00