Question about changing the cell style. In storyboard, i've created a cell: content: dynamic prototypes
in code, number of sections: 2.
Section one can use the layout created in the storyboard. The cells are filling perfect with data from the database. I'm trying to change the layout for cells in section 2 to the value1 style.
How can this be done?
Some of the code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"cartCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
switch (indexPath.section) {
case 0:
{
// Configure the cell...
NSInteger row = [indexPath row];
[[cell textLabel] setText:[cartItems objectAtIndex:row]];
return cell;
break;
}
case 1:
{
NSInteger row = [indexPath row];
switch (row) {
case 0:
[[cell textLabel] setText:@"Total1"];
break;
case 1:
[[cell textLabel] setText:@"Total2"];
}
return cell;
break;
}
}
}