Warm tip: This article is reproduced from stackoverflow.com, please click
ios swift xcode server

retrieving "createdAt" and "updatedAt" from Parse using Swift

发布于 2020-03-29 12:48:42

I've retrieved rows as objects from a class in Parse and store them in an array to use it later in a table view. I could successfully do that for all columns in the class except for two columns which are createdAt and updatedAt those two are created automatically by Parse every time we add a new row. enter image description here

When I print the array, I see all the columns except createdAt and updatedAt.

enter image description here

This is the function I created to retrieve the data and store it in the array of objects and it works fine except for createdAt and updatedAt.

enter image description here

Thanks for help in advanced!

Questioner
Ali Alzahrani
Viewed
61
Ali Alzahrani 2020-01-31 17:58

Actually I've found the answer which is that the columns objectId, createdAt and updatedAt that are created automatically by Parse are properties and we have to call them alone and they can't be retrieved with the whole object.

I called the object "article" so I can get the createdAt like this

let theDate = article.createdAt

The type here will be Date? and if you want to embed it within the table view you have to convert to String.