I want to add a custom UILabel
to my cell showing how long ago an item was posted. Any good links out there for a simple how to?
I want to add a label to my cell in storyboard, assign it a tag of say 22 and then programmatically calculate the time since the user posted an item.
EDIT: I don't care about my nil
value so I have changed my code to below. Now can someone either point me in the right direction to adding a timestamp or throw me a bone? Much appreciated
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
// Configure the cell...
PFObject *group = [self.groups objectAtIndex:indexPath.row];
UILabel *nameLabel = (UILabel*) [cell viewWithTag:101];
nameLabel.text = [group objectForKey:@"name"];
UILabel *usernameLabel = (UILabel*) [cell viewWithTag:103];
usernameLabel.text = [group objectForKey:@"creatorName"];
return cell;
}