I have four buttons in custom cell like ans1, ans2, ans3, ans4 in that i want to validate that buttons in didselectrowatindexpath
in each indexpath.row
how can i do that? i also set the button tags(1,2,3,4)?
here is my cellforatindexpath code
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellId = @"Cell";
ContestQATableViewCell *cell =(ContestQATableViewCell *)[tableViewQA dequeueReusableCellWithIdentifier:cellId];
if (cell==nil)
{
NSArray *myNib;
myNib =[[NSBundle mainBundle]loadNibNamed:@"ContestQATableViewCell" owner:self options:nil];
cell = (ContestQATableViewCell *)[myNib lastObject];
}
cell.question.text = [getContestQArray objectAtIndex:indexPath.row];
NSString *str1 = [getAnswer1Array objectAtIndex:indexPath.row];
NSString *str2 = [getAnswer2Array objectAtIndex:indexPath.row];
NSString *str3 = [getAnswer3Array objectAtIndex:indexPath.row];
NSString *str4 = [getAnswer4Array objectAtIndex:indexPath.row];
[cell.answer1 setTitle:str1 forState:UIControlStateNormal];
[cell.answer2 setTitle:str2 forState:UIControlStateNormal];
[cell.answer3 setTitle:str3 forState:UIControlStateNormal];
[cell.answer4 setTitle:str4 forState:UIControlStateNormal];
return cell;
}
if i click on ans1 remaining 3buttons will be deselect if i click on ans2 remaining 3buttons will be deselect and so on ... in each custom cell