title: Adding UIImageView dynamically in UITableViewCell
body: <p>I am using a UITableView to display some information about the consequences of driving to fast: What the fine is going to be etc. I also use some red "dots" that you get in your driving licence. Since this can be between 0 - 6 for each row I have done the following:</p>
  
  <pre><code>- (UITableViewCell *)tableView:cellForRowAtIndexPath:
  
  // Code if no cell is available in the que
  
  // End of that code
  
  UIImage *seniorImage = [UIImage imageNamed:@"ticket_dot.png"];
  
  if (seniorDots == 0) {
  
  } else {
      for (int i = 0; i &lt; seniorDots; i++) {
          UIImageView *seniorImageView = [[UIImageView alloc] initWithFrame:CGRectMake(40.0 + (i * 15.0), 40.0, 15.0, 40.0)];
          seniorImageView.image = seniorImage;
          seniorImageView.contentMode = UIViewContentModeCenter;
          [cell.contentView addSubview:seniorImageView];
          [seniorImageView release];
      }
  }
  </code></pre>
  
  <p>seniorDots is a variable that I get from a plist file. The code is working as intended but as you may see I have no way of removing them. So the first time I open the tableview I see the expected view, but if I scroll up again the code just keep adding UIImageViews on the cell, not removing the old ones. How can I reference these dots to remove them from screen before adding new ones?</p>