title: Objective C Cell Accessory view
body: <p>When I try to set the accessory view of a table view cell to a custom type image and run it in the simulator, I see that multiple cells have the accessory view image instead of the one that is currently selected. But when I set the accessory view to "cell.accessoryType = UITableViewCellAccessoryCheckmark;", I don't have this problem. Here is the code. </p>
  
  <pre><code>id item = [_items objectAtIndex:row];
  
  if ([_currentVale isKindOfClass:[NSString class]])
  {
      if ([item isEqualToString:_currentVale])
      {
  
          UIImageView *checkmark = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkmark-outline.png"]];
          checkmark.frame = CGRectMake(0, 0, 20, 20);
          cell.accessoryView = checkmark;
      }
      else
      {
          cell.accessoryType = UITableViewCellAccessoryNone;
      }
  }
  else if ([_currentVale isKindOfClass:[NSNumber class]])
  {
      if ([item isEqualToNumber:_currentVale])
      {
          cell.accessoryType = UITableViewCellAccessoryNone;
  
      }
      else
      {
          cell.accessoryType = UITableViewCellAccessoryNone;
  
  
      }
  }
  </code></pre>
  
  <p>Two images of what I'm talking about. Only one value should be chosen in the picker but there is two showing the checkmark</p>
  
  <p><a href="https://i.stack.imgur.com/7Tcgz.png" rel="nofollow"><img src="https://i.stack.imgur.com/7Tcgz.png" alt="Image 1"></a></p>
  
  <p><a href="https://i.stack.imgur.com/BTJWx.png" rel="nofollow"><img src="https://i.stack.imgur.com/BTJWx.png" alt="Image 2"></a></p>