
Untitled
By: a guest on
May 4th, 2012 | syntax:
None | size: 0.60 KB | hits: 11 | expires: Never
how to make check mark (one at a time) select in table view cell
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
NSIndexPath *oldIndexPath = self.selectedIndexPath; // retain this if not using ARC!
self.selectedIndexPath = indexPath; // passed in from didSelectRowAtIndexPath
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects: oldIndexPath, self.selectedIndexPath, nil], UITableViewRowAnimationNone];
// release oldIndexpath if noct using ARC