Using the following code I am getting the text.label but not the detailTextLabel.text. The NSLog is displaying correctly.
cell.textLabel.text = [eventLabels objectAtIndex:indexPath.row];
cell.detailTextLabel.text = [eventFields objectAtIndex:indexPath.row]];
NSLog(@"%@", [eventFields objectAtIndex:indexPath.row]);
I also tried...
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@", [eventFields objectAtIndex:indexPath.row]];
I have not had problems with this before. Any suggestions?
John
Make sure you're using an appropriate UITableViewCellStyle
with this (anything but UITableViewCellStyleDefault
should thus work). The cell's style is specified when you initialize it.
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];
}
Do remember to change to UITableViewCellStyleSubtitle
If you choose style UITableViewCellStyleSubtitle
, your detailTextLabel.text
will show
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] ;
UITableView Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With