标签: ckqueryoperation

CKError:查询过滤器超出了值的限制:容器为250

我想从公共数据库中下载大约500个"访问"记录.CloudKit一次只能为您提供100条记录,因此我只需使用下面的CKQueryCursor来获取我想要的所有记录.

func fetchVisits(_ cursor: CKQueryCursor? = nil) {
    print("fetchVisits \(cursor)")
    var operation: CKQueryOperation!
    if let cursor = cursor {
        operation = CKQueryOperation(cursor: cursor)
    } else {
        let query = CKQuery(recordType: "Visit", predicate: NSPredicate(format: "Client IN %@ AND ANY Students IN %@", visitClients, visitStudents))
        operation = CKQueryOperation(query: query)
    }
    operation.recordFetchedBlock = {
        (record) in
        totalVisits.append(record)
    }
    operation.queryCompletionBlock = {
        (cursor, error) in
        if let error = error {
            //handle error
        } else if let cursor = cursor {
            self.fetchVisits(cursor)
        } else …
Run Code Online (Sandbox Code Playgroud)

ios swift cloudkit ckqueryoperation

10
推荐指数
1
解决办法
325
查看次数

标签 统计

ckqueryoperation ×1

cloudkit ×1

ios ×1

swift ×1