Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Am I able to use recordID.recordName in a CKQuery?

CKQuery doc says: Key names used in predicates correspond to fields in the currently evaluated record. Key names may include the names of the record’s metadata properties such as "creationDate” or any data fields you added to the record.

What else metadata can I use in a CKQuery? Am I able to use record.recordID.recordName, if yes, what is the key for it?

like image 311
János Avatar asked Oct 06 '14 17:10

János


1 Answers

Yes, you could create a CKQuery for searching a recordID like this:

var query = CKQuery(recordType: recordType, predicate: NSPredicate(format: "%K == %@", "creatorUserRecordID" ,CKReference(recordID: theSearchRecordId, action: CKReferenceAction.None)))

Where theSearchRecordId is the recordID.recordName that you are looking for

Metadata fields are recordID, recordType, creationDate, creatorUserRecordID, modificationDate, lastModifiedUserRecordID, recordChangeTag

See https://developer.apple.com/library/ios/documentation/CloudKit/Reference/CKRecord_class/index.html#//apple_ref/doc/uid/TP40014044-CH1-SW14

like image 196
Edwin Vermeer Avatar answered Nov 01 '22 02:11

Edwin Vermeer