Field '___modTime' is not marked sortable

I'm using NSPersistentCloudKitContainer and I'm getting warnings in the console saying:

CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _scheduleAutomatedExportWithLabel:activity:completionHandler:]_block_invoke(3457): <NSCloudKitMirroringDelegate: 0x2831e40e0> - Finished automatic export - AppActivationExport - with result: <NSCloudKitMirroringResult: 0x280695d70> storeIdentifier: F2C60E7A-CEC4-44F2-B467-7324C065AD33 success: 0 madeChanges: 0 error: Error Domain=NSCocoaErrorDomain Code=134406 "Request '1FA53D40-43FB-4751-8719-0D26393D5301' was aborted because the mirroring delegate never successfully initialized due to error: <CKError 0x2806798c0: "Invalid Arguments" (12/2016); server message = "Field '___modTime' is not marked sortable"; op = DC861AAA03EBFBF0; uuid = 37A8231D-AB96-4B7C-8132-****9A0C1D39; container ID = "iCloud.com.***">" UserInfo={NSLocalizedFailureReason=Request '1FA53D40-43FB-4751-8719-0D26393D5301' was aborted because the mirroring delegate never successfully initialized due to error: <CKError 0x2806798c0: "Invalid Arguments" (12/2016); server message = "Field '___modTime' is not marked sortable"; op = DC861AAA03EBFBF0; uuid = 37A8231D-AB96-4B7C-8132-****9A0C1D39; container ID = "iCloud.com.***">}

I have added indexes for recordName and modifiedTimestamp to all my records as queryable as per the instructions.

Answered by peterwarbo in 753207022

Figured out I also had to had indexes for modifiedTimestamp to be sortable.

Accepted Answer

Figured out I also had to had indexes for modifiedTimestamp to be sortable.

Thank you, this solved a similar problem I was having.

Field '___modTime' is not marked sortable
 
 
Q