I don't understand why mine cell.detailTextLabel.textis null.
cell.detailTextLabel.text
static NSString *CellIdentifier = @"Cell"; //UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyId]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { /*[[NSBundle mainBundle] loadNibNamed:@"CellTest2" owner:self options:nil]; cell = mealPlanCell;*/ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; //self.mealPlanCell = nil; } cell.detailTextLabel.text = @"Test";
This will allow me to set the cell.textLabel.textvalue, but not verbose.
cell.textLabel.text
I figured out the reason if you leave
if(cell == nil){...}
around the cell = [[[UITableViewCell alloc] ...
, , / , , if(), , , , , , "", , , , , . , , , , , , .
: UITableViewCell initWithStyle: UITableViewCellStyleSubtitle
, ... , , , .
If your rowHeight is not tall enough, cell.detailTextLabel.text will not be visible even if cell.textLabel.text is displayed. The string High of 22 seems minimal with the default font.