I just started to learn Objective c. Now i want a under title (small grey text) under the ”big” title. i’m using the code:
cell.detailTextLabel.text = @"Test";
but in the simulator i do not see a under title.
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
cell.textLabel.text = [self.authorList objectAtIndex:[indexPath row]];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
You’re using
UITableViewCellStyleDefault. It does not support details.Use
UITableViewCellStyleSubtitleinstead.-edit-
If you’re using storyboards, remove all the cell init code and leave only the dequeue line. Then go to the interface builder and change the type of the cell there.