ios - NSPredicate with OR returning error -
i have problem following predicate:
nspredicate *predicate = [nspredicate predicatewithformat:@"(creatoruserrecordid == %@) or (touser == %@)", userid, userid]; when use in query ckquery *query = [[ckquery alloc] initwithrecordtype:@"message" predicate:predicate]; have error says: 'ckexception', reason: 'unexpected expression'.
when use these 2 seperately this:
nspredicate *predicate1 = [nspredicate predicatewithformat:@"(creatoruserrecordid == %@)", userid]; nspredicate *predicate2 = [nspredicate predicatewithformat:@"(touser == %@)", userid]; and performing query 1 of these predicates works fine. tried using nscompoundpredicate result same... ideas?
the documentation ckquery lists of valid predicate syntax. oddly, under "basic compound predicates" lists not, and, , &&. or , || not listed , apparently not supported cloudkit query predicates.
Comments
Post a Comment