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."

https://developer.apple.com/library/ios/documentation/cloudkit/reference/ckquery_class/index.html#//apple_ref/occ/cl/ckquery

so think beginswith should need. have not found case?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -