Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how to make check mark (one at a time) select in table view cell
  2. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  3.  
  4. [self.tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
  5.        
  6. NSIndexPath *oldIndexPath = self.selectedIndexPath; // retain this if not using ARC!
  7. self.selectedIndexPath = indexPath; // passed in from didSelectRowAtIndexPath
  8. [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects: oldIndexPath, self.selectedIndexPath, nil], UITableViewRowAnimationNone];
  9. // release oldIndexpath if noct using ARC