Ios creationDate是否可通过NSPersistentCloudKit容器访问?

Ios creationDate是否可通过NSPersistentCloudKit容器访问?,ios,swift,core-data,cloudkit,nspersistentcloudkitcontainer,Ios,Swift,Core Data,Cloudkit,Nspersistentcloudkitcontainer,在Cloudkit仪表板中,我可以看到记录的创建时间 但是,在我的应用程序中,当我使用 NSSortDescriptor(key: "creationDate", ascending: false) 我得到一个错误: <NSSQLFetchRequestContext: 0x6000034d8c40> , keypath creationDate not found in entity <NSSQLEntity ,在实体中找不到keypath creat

在Cloudkit仪表板中,我可以看到记录的创建时间

但是,在我的应用程序中,当我使用

NSSortDescriptor(key: "creationDate", ascending: false)
我得到一个错误:

<NSSQLFetchRequestContext: 0x6000034d8c40> , keypath creationDate not found in entity <NSSQLEntity

,在实体中找不到keypath creationDate您无法从核心数据模型访问creationDate,您可以创建自己的creationDate字段

如果要访问创建日期,应使用CloudKit方法获取记录,或使用NSPersistentCloudKitContainer
记录(对于managedObjectID:NSManagedObjectID)
方法