title: UITableview slow scroll and increase ram after some scrolls
body: <p>this is my code:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"hourCell" forIndexPath:indexPath];
  
  // Configure the cell...
  
  
      cell.textLabel.text=hoursarray[indexPath.row];
  
      if ([cell.contentView subviews]){
          for (UIView *subview in [cell.contentView subviews]) {
              [subview removeFromSuperview];
          }
      }
  
      UIButton *buttonOff = [UIButton buttonWithType:UIButtonTypeCustom];
  
      buttonOff.layer.cornerRadius = 5.0f;
      UIButton *buttonT1 = [UIButton buttonWithType:UIButtonTypeCustom];
      buttonT1.layer.cornerRadius = 5.0f;
      UIButton *buttonT2 = [UIButton buttonWithType:UIButtonTypeCustom];
      buttonT2.layer.cornerRadius = 5.0f;      
      buttonOff.frame = CGRectMake(130, 5, 40, 34);
      [buttonOff setTitle:@"OFF" forState:UIControlStateNormal];
      [buttonOff addTarget:self action:@selector(onButtonOFFTap:) forControlEvents:UIControlEventTouchUpInside];
      buttonT1.frame = CGRectMake(190, 5, 40, 34);
      [buttonT1 setTitle:@"T1" forState:UIControlStateNormal];
      [buttonT1 addTarget:self action:@selector(onButtonT1Tap:) forControlEvents:UIControlEventTouchUpInside];
      buttonT2.frame = CGRectMake(250, 5, 40, 34);
      [buttonT2 setTitle:@"T2" forState:UIControlStateNormal];
      [buttonT2 addTarget:self action:@selector(onButtonT2Tap:) forControlEvents:UIControlEventTouchUpInside];
  
      [cell addSubview:buttonOff];
      [cell.contentView bringSubviewToFront:buttonOff];
      buttonOff.tag=indexPath.row;
  
      [cell addSubview:buttonT1];
      [cell.contentView bringSubviewToFront:buttonT1];
      buttonT1.tag=indexPath.row;
  
      [cell.contentView bringSubviewToFront:buttonT2];
      [cell addSubview:buttonT2];
      buttonT2.tag=indexPath.row;
  
      if([[NSString stringWithFormat:@"%@",[datiProgrTemp objectAtIndex:indexPath.row+48*day]] isEqual:@"1"])
      {
          buttonOff.backgroundColor = [UIColor greenColor];
          buttonT1.backgroundColor = [UIColor lightGrayColor];
          buttonT2.backgroundColor = [UIColor lightGrayColor];
      }
      if([[NSString stringWithFormat:@"%@",[datiProgrTemp objectAtIndex:indexPath.row+48*day]] isEqual:@"2"])
      {
          buttonOff.backgroundColor = [UIColor lightGrayColor];
          buttonT1.backgroundColor = [UIColor greenColor];
          buttonT2.backgroundColor = [UIColor lightGrayColor];
      }
      if([[NSString stringWithFormat:@"%@",[datiProgrTemp objectAtIndex:indexPath.row+48*day]] isEqual:@"3"])
      {
          buttonOff.backgroundColor = [UIColor lightGrayColor];
          buttonT1.backgroundColor = [UIColor lightGrayColor];
          buttonT2.backgroundColor = [UIColor greenColor];
      }
  return cell;
  </code></pre>
  
  <p>}</p>
  
  <p>The fact is that after two or three scrolls (fast and smooth) the scrolling goes slow and crappy and the ram used increase.
  I tried to put if(cell==nill) but I'm using storyboard and the cell is never nill</p>
  
  <p>Am I wrong in something?</p>
  
  <p>Thanks a lot,
  N.</p>