ios - CloudKit : CKQuery showing error: error: The operation couldn’t be completed. (CKErrorDomain error 1.) -
i working on ios app implementing cloudkit need query records id greater number. example have record id of 23:
here code:
ckcontainer *mycontainer = [ckcontainer containerwithidentifier:containerid]; ckdatabase *publicdatabase = [mycontainer publicclouddatabase]; ckrecordid *recordid = [[ckrecordid alloc] initwithrecordname:@"23"]; ckreference* recordtomatch = [[ckreference alloc] initwithrecordid:recordid action:ckreferenceactionnone]; nspredicate *predicate = [nspredicate predicatewithformat:@"recordid >= %@", recordtomatch]; ckquery *query = [[ckquery alloc] initwithrecordtype:recordtype predicate:predicate]; [publicdatabase performquery:query inzonewithid:nil completionhandler:^(nsarray *results, nserror *error) { if (error) { nslog(@"error: %@", error.localizeddescription); } else { } }];
but i'm getting following error:
error: error: operation couldn’t completed. (ckerrordomain error 1.)
any of knows how can setup nspredicate in way can records id greater 23 ?
i'll appreciate help.
for query use predicate like:
in swift:
var predicate = nspredicate(format: "recordid >= %@", ckrecordid(recordname: "23"))
in objective c:
nspredicate *predicate = [nspredicate predicatewithformat:@"recordid >= %@", [ckrecordid initwithrecordname:@"23"]];
then assume created ckrecords object while specifying number. otherwise recordid values assigned cloudkit , guid.
Comments
Post a Comment