gpt4 book ai didi

cloudkit - 查询系统字段时出现CKError : rejected "Unknown Field ' createdAt'"

转载 作者:行者123 更新时间:2023-12-01 10:22:19 25 4
gpt4 key购买 nike

我正在对 createdAt 系统字段进行排序,如下所示:

query.sortDescriptors = [NSSortDescriptor(key: "createdAt", ascending: false)]

并得到以下错误:

CKError 0x1c4447fb0: "Invalid Arguments" (12/2018); server message = "Unknown field 'createdAt'"; uuid = 9C450848-2449-4892-93BC-C46363203042; container ID = "...



我能够查询和排序我以这种方式创建的字段。与系统字段有什么不同吗?
该字段的索引是可排序和可查询的。

最佳答案

改为使用 creationDate 作为 key 。 CK 仪表板中的元键与用于查询的元键略有不同。这是元键列表:

recordID: CKRecordID
The unique ID of the record.

recordType: String
The app-defined string that identifies the type of the record.

creationDate: Date?
The time when the record was first saved to the server.

creatorUserRecordID: CKRecordID?
The ID of the user who created the record.

modificationDate: Date?
The time when the record was last saved to the server.

lastModifiedUserRecordID: CKRecordID?
The ID of the user who last modified the record.

recordChangeTag: String?
A string containing the server change token for the record.

关于cloudkit - 查询系统字段时出现CKError : rejected "Unknown Field ' createdAt'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49930687/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com