Reputation: 80
I am making an app that uses cloud-kit, and when I ask it to return the data saved on it, its out of order. How to i organize the data by date? And then save it in an array, with array [0] as the most recent data added? by the way, the view controller that saves the data is a different view controller that loads it.
Upvotes: 1
Views: 87
Reputation: 13127
You could ad a sort order to your query like this:
query.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
Upvotes: 1