I'm trying to figure out how to query the index of my records in cloudkit using Objective-C. I build a query to fetch all my records:
CKContainer *container = [CKContainer containerWithIdentifier:containerID];
CKDatabase *publicDatabase = [container publicCloudDatabase];
CKQuery *query = [[CKQuery alloc] initWithRecordType:recordType
predicate:[NSPredicate predicateWithFormat:@"TRUEPREDICATE"]];
[publicDatabase performQuery:query
inZoneWithID:nil
completionHandler:^(NSArray *results, NSError *error)
{
if (!error)
{
NSLog(@"results query %@", results);
}
else
{
NSLog(@"FETCH ERROR: %@", error);
}
}];
But I need to get the index of each record. Any of you knows how can only query the index of all records?
I'll really appreciate your help
instead of a CKQuery use a CKQueryOperation. you could then set the desiredKeys property to limit the result to only the id's. You could use something like: