title: Set checkmark in UITableView
body: <p>I'm trying to set checkmark in rows which are selected in UITableView (placed in popup view). Actually I have something like this:</p>
  
  <pre><code>-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 
  {
      // Check if current row is selected
      Boolean isNowChecked = NO;
      if([self.tableView cellForRowAtIndexPath:indexPath].accessoryType == UITableViewCellAccessoryCheckmark) 
      {
          isNowChecked = YES;
      }
  
      if(isNowChecked) 
      {
          [self.tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryNone;
      }
      else 
      {
          [self.tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
      }
      return indexPath;
  }
  </code></pre>
  
  <p>In result I'm able to select rows, for example I touch first item then I see checkmark. When I scroll down my table view, then I see that I have check also other items (number 17, 32). When I uncheck my first item, then every check also disappear.</p>
  
  <p>Do you have any suggestions what could be reason of this situation, and how can I avoid it?</p>