简体   繁体   中英

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

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. 在此处输入图片说明

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

在此处输入图片说明

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 .

在此处输入图片说明

Thanks for help in advanced!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM