Tag: 单元格格式

cell.detailTextLabel.text是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"; 它会让我把cell.textLabel.text设置为一个值,但不是细节之一。