Skip to content

Instantly share code, notes, and snippets.

View wangruocong's full-sized avatar

Roy Wang wangruocong

View GitHub Profile
@UjwalManjunath
UjwalManjunath / Multiplecheckmultiplesection
Created August 1, 2013 19:14
adding checkmark accessary to multiple sections(checking one cell at a time in each section)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:indexPath.row inSection:indexPath.section]].accessoryType = UITableViewCellAccessoryCheckmark;
[self deSelectOtherCellsInTableView:tableView Except:indexPath];
}
-(void)deSelectOtherCellsInTableView:(UITableView *)tableView Except:(NSIndexPath *)indexPath{
for(UITableViewCell *cell in [tableView visibleCells]){
NSIndexPath *index = [tableView indexPathForCell:cell];
if(index.section == indexPath.section && index.row != indexPath.row){