ExpandableTableView
ExpandableTableView copied to clipboard
If isMultipleSelected is set to NO, getting exception when button of same section is tapped multiple times.
When I made isMultipleSelected NO, it is working fine if I will tap on buttons of different sections. But if I tap on the button of same section for 2 times, it will give exception if I will tap button of any section for 3rd time.
Dear RAhul,
Replace This function its start working :)
-(IBAction)btnTapShowHideSection:(UIButton*)sender { if (!sender.selected) { if (!isMultipleExpansionAllowed) {
if(_arrSelectedSectionIndex.count == 0){
[_arrSelectedSectionIndex addObject:[NSNumber numberWithInteger:sender.tag-1]];
}else{
[_arrSelectedSectionIndex replaceObjectAtIndex:0 withObject:[NSNumber numberWithInteger:sender.tag-1]];
}
}else {
[_arrSelectedSectionIndex addObject:[NSNumber numberWithInteger:sender.tag-1]];
}
sender.selected = YES;
}else{
sender.selected = NO;
if ([_arrSelectedSectionIndex containsObject:[NSNumber numberWithInteger:sender.tag-1]])
{
[_arrSelectedSectionIndex removeObject:[NSNumber numberWithInteger:sender.tag-1]];
}
}
if (!isMultipleExpansionAllowed) {
[tblView reloadData];
}else {
[tblView reloadSections:[NSIndexSet indexSetWithIndex:sender.tag-1] withRowAnimation:UITableViewRowAnimationAutomatic];
}
}