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
0
votes
1 answer

CKQuery with Todays Date

Would really value some support. I am designing an tvOS app which displays certain CloudKit content in a tableView, the data is different depending on the current date. Each calendar date correspondents to the data within that Type. e.g. RecordType…
Matt T
  • 1
  • 1
0
votes
1 answer

Trouble with Couldkit Query and using predicates on field of CKReference

i have a basic missunderstanding about how CKQuery works. I have 2 Record types : Friends : containing fields url_of_profil_pic name ... Vote : containing fields date_of_vote target_of_the_vote (Friends CKReference) the_one_who_vote…
0
votes
1 answer

CKQuery Perform Only Fetches Records That Are Created Before Application Is Launched

I have iOS and macOS applications that I have been working on. With the iOS app, the user sends data to iCloud Drive while they use the macOS counterpart to receive data. The following lines of code come from the macOS application. func…
El Tomato
  • 6,479
  • 6
  • 46
  • 75
0
votes
1 answer

Fetch large set using CKQueryOperation and CKReference

I have a CKReference attached to 4000 records linked to one CKRecord. They have no action (CKReferenceActionNone). I want to be able to fetch all these records using, CKQueryOperation using NSPredicate as follows: CKReference* recordToMatch =…
Ken Chan
  • 21
  • 1
  • 3
0
votes
1 answer

CloudKit Notifications not delivered to all devices

I have the problem that CloudKit notifications are not delivered to all devices when my app was started on the device. However, everything works fine if the app has been started from XCode. In specific: Device A saves a record On the server, there…
0
votes
1 answer

Add multiple fields to the same recordName row in CloudKit

I am trying to save multiple values to CloudKit (Name, Username, Points). However, when I save them, they save separately in 3 different rows, like so: I want to combine the Name, Username, and Points fields into one row so I can load them…
Andy Lebowitz
  • 1,471
  • 2
  • 16
  • 23
0
votes
2 answers

Swift predicate only matches first value in array of values

I have a class Download that serves as a wrapper for CKQueryOperation. One of the inits allows me to build my predicate with an array of values: init(type: String, queryField: String, queryValues: [CKRecordValue], to rec: RecievesRecordable, from…
Mercutio
  • 1,152
  • 1
  • 14
  • 33
0
votes
1 answer

CKQuery Comparing Dates returns empty array

I am attempting to query a CloudKit private database by comparing two date fields. let predicate = NSPredicate(format: "timeStamp == %@", parcoursTimeStamp as CVarArg) let query = CKQuery(recordType: "ParcoursRecord", predicate:…
Pete
  • 213
  • 1
  • 13
0
votes
0 answers

CloudKit Subscription With Multiple Comparisons

I'm trying to create a subscription for CloudKit Notifications but I can't seem to get the predicate right. Simple notifications, with just a one comparison predicate show up, so the payload is configured correctly, but If I make the predicate a…
Alejandro
  • 367
  • 3
  • 10
0
votes
1 answer

How do I get a list of RecordTypes in a Database?

I want to list all records in a Database. To do this using CKQuery, it appears I must have a recordType. The predicate will be TRUEPREDICATE. How can I get a list of RecordTypes, for eventual use within CKQuery? (e.g. I'll loop through the list,…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
0
votes
1 answer

CKQuery for array containing any from array (Swift)

I would like to create a CKQueryOperation that finds records where an array contains any items from another array. It does not need to contain all of the elements from the second array, just at least one. I have this line which works for an array…
Tom Coomer
  • 6,227
  • 12
  • 45
  • 82
0
votes
0 answers

CloudKit query by oldest modified record

I am working with CloudKit and attempting to fectch records by "modificationDate" but will populate my results limit starting with the oldest. For instance, if I have 4 records created mon, tues, wed, thurs and I select just two of them, I would get…
0
votes
2 answers

Reason for existence of CKQueryOperation when CKQuery exists

Other than the ability to chain different CKQuerys, and the ability to set the limit of retrieve results, why else does one need CKQueryOperation? Are basically those two functionalities it? Because I'm just not sure what the reason for have…
shle2821
  • 1,856
  • 1
  • 19
  • 26
0
votes
1 answer

CKQuery with CloudKit Issue

I'm very new to CloudKit and am simply trying to run the most basic query. I want to pull from RecordType "Users" and field type "Name" and have the name equal to my nameText label! Please see my code below: func getUserInformation() { let…
pmoney13
  • 1,075
  • 3
  • 11
  • 19
0
votes
1 answer

how to perform a query by the field as well as the record type

I was wondering if it was possible to search for a CKRecord by not only its record type but as well as its field in the database. For example heres my code I have now to fetch records: database.performQuery(query, inZoneWithID: nil,…
Garret Kaye
  • 2,412
  • 4
  • 21
  • 45