I\'m an experienced Android developer trying to get a prototype iOS app running using the Parse service and sdk (https://www.parse.com/).
It\'s great, and i can get all
Silly Matt. I think about this for a day then realise my mistake minutes after i post it.
updatedAt is a property on all PFObjects, no need to retrieve it using a key.
Given a PFObject named object...
NSDate *updated = [object updatedAt];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"EEE, MMM d, h:mm a"];
cell.detailTextLabel.text = [NSString stringWithFormat:@"Lasted Updated: %@", [dateFormat stringFromDate:updated]];
@Parse , tip of the hat
I just had the same problem, don't access it using objectForKey, just access it directly via the createdAt property.
in Swift
object.createdAt
As stated in the docs, the keys:
This do not include createdAt, updatedAt, authData, or objectId. It does include things like username and ACL.
For Swift:
let dateUpdated = object.updatedAt! as NSDate
let dateFormat = NSDateFormatter()
dateFormat.dateFormat = "EEE, MMM d, h:mm a"
cell.updatedAtLabel.text = NSString(format: "%@", dateFormat.stringFromDate(dateUpdated))