I have a table view that I want 3 different custom cells in it, right now this code only has one.
How can I modify my code so that case 2 and case 9 both have their own custom table cells with their own cell identifiers? Keep in mind this code is inside an if/else statement because I have 2 different tableviews in my VC.
static NSString *CellIdentifier = nil;
if (tableView == self.mytableview)
{
}
else if (tableView == self.vitalsTableView)
{
CellIdentifier = @"textCell";
VitalsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
switch (indexPath.row) {
case 0:
cell.vitalsLabel.text = @"Temperature";
break;
case 1:
cell.vitalsLabel.text = @"Pulse";
break;
case 2:
cell.vitalsLabel.text = @"Blood Pressure";
break;
case 3:
cell.vitalsLabel.text = @"Respiratory Rate";
break;
case 9:
cell.vitalsLabel.text = @"Smoking Status";
break;
default:
break;
}
return cell;
}
It would be something like you already have but with a minor modification of the class you modify and the identifiers, I hope I got what you were asking.