Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is creationDate accessible through NSPersistentCloudKitContainer?

In the Cloudkit Dashboard, I can see a Created time for the record.

However, in my app when i use

NSSortDescriptor(key: "creationDate", ascending: false)

I get an error:

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

I suspect I cannot access creationDate using NSPersistentCloudKitContainer?

like image 453
ImStuck Avatar asked Sep 14 '25 23:09

ImStuck


1 Answers

You can't access creationDate from Core Data models, you can create your own creationDate field.

If you want to access creation date you should use CloudKit methods for fetching records or NSPersistentCloudKitContainer record(for managedObjectID: NSManagedObjectID) method.

like image 104
Stamenkovski Avatar answered Sep 16 '25 14:09

Stamenkovski