I have a tableview which contains:
-2 custom cells : redCell and blueCell
-2 buttons : redButton and blueButton at bottom of the screen.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.section == 0) {
RedTableViewCell *redCell = (RedTableViewCell *)[tableView dequeueReusableCellWithIdentifier:BlockListTableViewCellIdentifier forIndexPath:indexPath];
Red *red = (Red *)[self.reds objectAtIndex:indexPath.row];
return redCell;
}
else
{
BlueTableViewCell *blueCell = (BlueTableViewCell *)[tableView dequeueReusableCellWithIdentifier:RestBlockTableViewCellIdentifier forIndexPath:indexPath];
Blue *blue = [self.blues objectAtIndex:indexPath.row];
return blueCell;
}
return nil;
}
I want that when i click redButton = redCell added ,click blueButton = blueCell added.
P/S : I don't want to change the background color, I want 2 different cells.