title: Is it possible to set Cell background color per section?
body: <p>I'm trying to set the cell background color based on the section number but it's not working quite right. Cell colors change and are wrong as I scroll back and forth. I'm trying to do it using a color variable that is set in <code>willDisplayHeaderView</code> and is then used in <code>willDisplayCell</code>. Here's the code:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view     forSection:(NSInteger)section{
  
      if(section % 2 == 0){
          self.currentCellColor =[UIColor colorWithRed:(199/255.0) green:(214/255.0) blue:(156/255.0) alpha:1];
      }
      else{
          self.currentCellColor = [UIColor colorWithRed:(242/255.0) green:(245/255.0) blue:(232/255.0) alpha:1];
      }
  }
  
  - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
      cell.backgroundColor = self.currentCellColor;
  }
  </code></pre>
  
  <p>Also sections aren't vital to this piece of functionality so if anyone has a better/easier way of achieving this in one big section then feel free to suggest it. I just need to change the color every 4 rows.</p>