I want to add UIlable
that represent the time when post created
I tried 3 different methods without any success
PS: Am using PFQueryTableViewController
Update :
var dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "MM-dd-yyyy HH:mm"
var useDate = dateFormatter.stringFromDate
cell.dateLabel.text = useDate
After above Code I get this error > can't assign of type NSDate -> string to type String? the error is points to cell.dateLabel.text = useDate
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject ? ) - > PFTableViewCell ?
{
let cell = tableView.dequeueReusableCellWithIdentifier("cellImg", forIndexPath: indexPath) as!MoreCell
//Trial 1
cell.dateLabel.text = object ? .objectForKey(createdAt)
//Trial 2
cell.dateLabel.text = object ? .objectForKey("createdAt") as ? String
//Trial 3
cell.dateLabel.text = object ? .createdAt
//Trial 4
cell.dateLabel.text = object?.updatedAt >> Error Can't assign value of type NSDate to type string?
}