WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

Project 33 - What's that Whistle / CloudKit error

Forums > 100 Days of Swift

in the section: Reading from iCloud with CloudKit: CKQueryOperation and NSPredicate

Being that the CloudKit site was completely revamped and the Schema metadata has been changed as well the "creationDate" has been decpreciated. However, now there's a property called "createdTimestamp" and when I'm tried to make this both Sortable and Queryable it still returns and error. As a work around created a newe property in Records Field called "date" and on the sort instance on the view controller I changed it to "date" and it's working. Wondering if anyone has ran into this issue and how they solved it.

let sort = NSSortDescriptor(key: "createdTimestamp", ascending: false)

error returned: Unknown field 'createdTimestamp'

2      

I had to reply, so that the others would know. It's true you'd get that exact error even though createdTimestamp does exist in the metadata of your record when you check it on the icloud. You can definitely still use the old creationDate.

1      

Hacking with Swift is sponsored by Emerge

SPONSORED Why are Swift reference types bad for app startup time, and what’s the performance cost of protocol conformances? That’s just a couple of the topics you can learn about on the Emerge blog — written by the app performance experts behind Emerge’s advanced app optimization and monitoring tools, based on their experience of working at companies like Apple, Airbnb, Snap, and Spotify.

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.