user1130902
user1130902

Reputation: 1

Getting unexpected expression error from NSPredicate

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?

Upvotes: 0

Views: 133

Answers (1)

Related Questions