I'm creating a school app that displays the messages, users and the timestamp. I tried looking online for a fix to this but i couldn't find anything that I could understand. I'm new to programming and anything could help. I read somewhere that NSLog could help but I don't know how it's used. Please help!
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"messagesCell";
MessageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
reversedMessages = [[messagesArray reverseObjectEnumerator] allObjects];
PFObject *tempObject = [reversedMessages objectAtIndex:indexPath.row];
cell.cellTitle.text = [tempObject objectForKey:@"content"];
cell.userName.text = [tempObject objectForKey:@"user"];
NSDate *createdAt = [tempObject createdAt];
NSDateFormatter *dateDisplay = [[NSDateFormatter alloc] init];
[dateDisplay setDateFormat:@"MMM, d h:mm a"];
**cell.timeStamp.text = [NSString stringWithFormat: [dateDisplay stringFromDate:createdAt]];**
return cell;
}