ios - NSPredicate case insensitive string search with CloudKit -
i'm trying search string field of cloudkit object. following line compiles , runs without error.
nspredicate(format: "title beginswith %@", "apple")
yet, when try add case insensitive search, app crashes.
nspredicate(format: "title beginswith[cdl] %@", "apple")
with error:
*** terminating app due uncaught exception 'ckexception', reason: 'invalid predicate: title beginswith[cdl] "apple" (error domain=ckerrordomain code=12 "invalid operator in <title beginswith[cdl] "apple">: unsupported operator: beginswith" userinfo=0x7fb69d02e910 {ck_iscomparisonerror=true, nslocalizeddescription=invalid operator in <title beginswith[cdl] "apple">: unsupported operator: beginswith, nsunderlyingerror=0x7fb69d02e9e0 "unsupported operator: beginswith"})'
as documentation on ckquery: "string-based comparisons case insensitive otherwise comparisons must exact match of specified value."
so think beginswith should need. have not found case?
Comments
Post a Comment