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: predicate)
privateDatabase.perform(query, inZoneWith: recordZone.zoneID, completionHandler: { (result, error) in
if let error = error {
print("Error querying for record: \(error.localizedDescription)")
} else {
print("Query result: \(result)")
}
})
I only receive Query result: Optional([ ]) but never any results although I know the timeStamps I am comparing are the same. What am I doing wrong? Is the predicate defined incorrectly (which would be me guess)?