Questions tagged [ckquery]

CKQuery is a component of the cloudkit iOS Developer Library. A CKQuery object manages the criteria to apply when searching for records in a database.

CKQuery is a component of the cloudkit iOS Developer Library. A CKQuery object manages the criteria to apply when searching for records in a database.

You create a query object as the first step in the search process. The query object stores the search parameters, including the type of records to search, the match criteria (predicate) to apply, and the sort parameters to apply to the results. The second step is to use the query object to initialize a CKQueryOperation object, which you then execute to generate the results.

Available in iOS 8.0 and later.

Read the official reference for further details

81 questions
3
votes
0 answers

CloudKit CKQueryOperation doesn't get all records

In CloudKit RecordType is more than 100 records. Following code gets from these only 11 and they are not first 11 records, they are picked randomly from beginning, center and at the end of records. I can't get whats wrong in code. EDIT : I got it…
Erva
  • 47
  • 8
3
votes
1 answer

CKQuery with NSPredicate fails when using "CONTAINS" operator

According to Apples Class Reference CKQuery, the operator CONTAINS is one of the supported operators. However, that doesn't seem to work. I have a RecordType called myRecord, and a record with field name name type String. I try to fetch the record…
Tom Tallak Solbu
  • 559
  • 6
  • 20
3
votes
1 answer

CloudKit Fetch First Record Only

I'd like to know how to fetch just the first record from a CloudKit table. For example, I have a table for "Classes" and I only want to get the class that was last modified, instead of getting all of the classes like I do now: let pred =…
Pavel B.
  • 63
  • 3
3
votes
4 answers

CKQueryOperation working with big batch

I have problem with creating CKQuery operation with big batch of data. My query works with 100 results but after more results query fail, because one thread is bad dispatched or something (libdispatch.dylib`dispatch_group_leave: ) i am lost... any…
huv1k
  • 294
  • 2
  • 10
3
votes
0 answers

CloudKit relationships CKReference setup and query.

I’m allowing Users to save locations. It is saving in cloudKit, I can fetch all the locations successfully. For each location saved there is a record who created it "created by: IDXXX". How do I pull all the locations saved by the single user who…
julien
  • 437
  • 4
  • 9
3
votes
1 answer

Strange error with CloudKit query

I am getting a very generic error for a CloudKit query. I am not sure how to fix it. Does anyone have any suggestions? The error is Error occurred. Error =
Andy Dewan
  • 245
  • 1
  • 2
  • 18
3
votes
3 answers

CKQueryOperation get the last record

I need to fetch the very last record in cloudkit. Here is my code: CKContainer *container = [CKContainer containerWithIdentifier:containerID]; CKDatabase *publicDatabase = [container publicCloudDatabase]; CKQuery *query = [[CKQuery alloc]…
user2924482
  • 8,380
  • 23
  • 89
  • 173
3
votes
2 answers

Can't query based on User ID in Cloudkit

I don't understand why my ckquery does not fetch the records created by the user. Here is my code: @IBAction func browseMyComplaints(sender: AnyObject) { // who am i? CKContainer.defaultContainer().fetchUserRecordIDWithCompletionHandler({…
Narwhal
  • 744
  • 1
  • 8
  • 22
2
votes
1 answer

Understanding how to correctly execute CKQueryOperation

I'm working with CloudKit for the first time and am having trouble executing a CKQueryOperation to query all records of a given type. It doesn't help that Apple has deprecated most of the stuff I've found online and that their documentation for…
JonGrimes20
  • 115
  • 9
2
votes
1 answer

CloudKit "subscription is duplicate of" error - get SubscriptionId

I'm trying to save a CKQuerySubscription to the public database - a CKError is returned with the following information: [ "ServerErrorDescription": subscription is duplicate of 'C82E82EF-F373-4D75-A465-65364D8FEB12', "CKErrorDescription":…
Max Chuquimia
  • 7,494
  • 2
  • 40
  • 59
2
votes
1 answer

Use CONTAINS or ANY in CloudKit predicate with an array of comparison

I tried to use NSCompoundPredicate(orPredicateWithSubpredicates:) with CloudKit NSPredicate but then I read on Apple's documentation that OR comparison predicates aren't supported in CloudKit so I hit a road-block with this. I have an array of…
Ivan Cantarino
  • 3,058
  • 4
  • 34
  • 73
2
votes
1 answer

CloudKit predicate: Search multiple reference fields with predicate of CKQuery

Using Apple CloudKit, I have a record user and a join table record to connect users and to save the state of the relationship. This means that users can request to be friends and the other party has to accept first. Now I want to query for those…
bnassler
  • 591
  • 6
  • 15
2
votes
1 answer

Cloudkit returning records with a specific string

In my project, with a CloudKit Record Type "User"(I've tested with other Record Type names too) I create a record with an email field. I'm trying to match that email exactly and fetch records that match. I am doing this with an IN or == predicate,…
JDM
  • 883
  • 1
  • 8
  • 20
2
votes
2 answers

CloudKit: CKQueryOperation for deleted records

Is there a way to query CloudKit for recently deleted items (from a particular timestamp, perhaps), without using CKFetchRecordChangesOperation? I am using a public database so I can't use custom zones (which would be a requirement for…
Z S
  • 7,039
  • 12
  • 53
  • 105
2
votes
1 answer

CKQueryOperation resultLimit max and request count

What would be the max figure for resultLimit? I'm coming from parse.com so i'm used to using batch downloads that would comfortably pull 1000 rows of data at once when this would count as one request call. What kind of limitations are there in…
shle2821
  • 1,856
  • 1
  • 19
  • 26