I have followed this tutorial for RadioButton.I have integrated it with tableview.The problem is that when I select table row then radio button does not get selected. It gets selected only when I click on RadioButton. I want the radio button to get selected when table row is selected.The code is as follows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *simpleTableIdentifier = @"SimpleTableItem";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
}
RadioButton *rb1 = [[RadioButton alloc] initWithGroupId:@"Group" index:indexPath.row];
rb1.frame = CGRectMake(20,13,22,22);
[cell.contentView addSubview:rb1];
cell.textLabel.text = @"ABC";
return cell;
}