Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You want both first name AND last name on the main label, and a date on another? Or all three on the same label? Or in three different as in suggested answer?</p> <p>This might be the easiest way to achieve something like you're requesting:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (!cell)//Setting CellStyle to Subtitle, might have to change that in Storyboard as well, by clicking the cell and choose Subtitle as style cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; Contacts *contacts = [self.fetchedResultsController objectAtIndexPath:indexPath]; //If I understood right, you knew how to get firstName, and lastName(through .name?), but not both at the same time into the same label? //Switch out the following 'contacts.firstName' and 'contacts.name' to fit your needs if it's not right: NSString *fullName = [NSString stringWithFormat:@"%@ %@", contacts.firstName, contacts.name]; cell.textLabel.text = fullName; //And put the date on the 'subtitle'(detailTextLabel). Might not work if the date-variable isn't a text, but another type of object, like NSDate etc. cell.detailTextLabel.text = contacts.date; return cell; } </code></pre> <p>If your contacts.date-variable turns out to be an NSDate, take a look at <a href="https://stackoverflow.com/questions/576265/convert-nsdate-to-nsstring">this link</a> to put the date in an NSString, and then use <code>cell.detailTextLabel.text = stringFromDate;</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload