Please help me to get all rows of same group in tableView. i am using below code to show radio/check in groups of tableview and want the only one per group selection.
so for that i have got 2 images 1:uncheck 2:checked so when user will click/select a row of group than i am changing its cell.image to "checked" and its working but don't know how to make all other cell's images of same group's to "unchecked"
dont know how to loop through (get) all rows/cells of current group
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSArray *listData =[self.tableContents objectForKey:
[self.sortedKeys objectAtIndex:[indexPath section]]];
NSUInteger row = [indexPath row];
NSString *rowValue = [listData objectAtIndex:row];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.image = [UIImage imageNamed:@"checkbox-checked.png"];
NSString *message = [[NSString alloc] initWithFormat:rowValue];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"You selected"
message:message delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[message release];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}