Edwin Vermeer
Edwin Vermeer

Reputation: 13127

CloudKit data purged again and now I cannot sort on creationDate

This morning I suddenly got this error:

Error Domain=CKInternalErrorDomain Code=2016 "Field '___createTime' is not marked sortable"

This was caused by this statement:

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

Going to the CloudKit Dashboard I noticed that all my records were purged and apparently the model was recreated. When clicking on metadata index fields I could see that none of those are sortable anymore. From the Dashboard it's not possible to enable this. Is there any other way to enable this? Or do I just have to add my own sortable date field?

Upvotes: 4

Views: 525

Answers (2)

Kenny
Kenny

Reputation: 2186

I am getting an error today that I didn't get yesterday, so it may be that they are changing things on us...

This is the error I am seeing today:

X-MMe-Client-Info/X-Apple-Client-Info header did not meet the minimum build version, rejecting request

I haven't made any changes to my code, so it's not me.

I also noticed the records I had stored are gone. I'm wondering if this is normal. I realize it's still in beta, so perhaps it is to be expected.

Upvotes: 0

Edwin Vermeer
Edwin Vermeer

Reputation: 13127

Now a couple of hours later I am able to change the searchable and sortable of these fields. So this was probably a temporary CloudKit Dashboard hickup

Upvotes: 2

Related Questions