How to query CloudKit for recordID IN [CKRecordID]

前端 未结 2 1744
夕颜
夕颜 2021-02-06 03:48

My predicate wants to exclude some records that are already downloaded and available in a [CKRecordID]. Now I can query 1 CKRecordID[0], but not the [CKRecordID] array. How can

相关标签:
2条回答
  • 2021-02-06 04:03

    Using [CKReference] and not [CKRecordID] solved it.

    0 讨论(0)
  • 2021-02-06 04:11

    To be explicit (because it took me hours to get this right)...

    let refs = excludeIDs.map { CKRecord.Reference(recordID: $0.recordID, action: .none) }
    let pred1 = NSPredicate(format: "NOT(recordID IN %@)", refs)
    
    0 讨论(0)
提交回复
热议问题