11
4

2 回答 2

23

是的,您可以创建一个 CKQuery 来搜索这样的记录 ID:

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

其中 theSearchRecordId 是您要查找的 recordID.recordName

元数据字段为recordID、recordType、creationDate、creatorUserRecordID、modificationDate、lastModifiedUserRecordID、recordChangeTag

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

于 2014-10-06T19:38:07.590 回答
0

我喜欢:

NSPredicate *predicate= [NSPredicate predicateWithFormat:
      @"recordID = %@",[[CKRecordID alloc] initWithRecordName:theRecordNameForThisRecord]];
于 2018-05-02T21:53:27.963 回答