How to query CloudKit for recordID IN [CKRecordID]

前端 未结 2 1743
夕颜
夕颜 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: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)
    

提交回复
热议问题