SKSTableView
SKSTableView copied to clipboard
Selection cell issue - when first & second cell are expanded
I'm encountering an issue, when I expand the first and second cell and select from the first expanded sub row cell, I get the second row name with the first selected sub row name. What I should get is the first name with first sub row name instead. How I can fix this issue?
My Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
SKSTableViewCell *cell = (SKSTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
UITableViewCell *selectedCell = [self tableView:_tableView cellForSubRowAtIndexPath:indexPath];
_selectedCellTxt = selectedCell.textLabel.text;
if ([cell respondsToSelector:@selector(isExpandable)]){
if ([cell isExpandable])
{
NSLog(@"SELECTED Row %@", _selectedCellTxt);
}
else{
_selectedCellTxt = selectedCell.textLabel.text
[self performSegueWithIdentifier:@"123" sender:self];
}
}
- (void)tableView:(SKSTableView *)tableView didSelectSubRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *selectedCell = [self tableView:_tableView cellForSubRowAtIndexPath:indexPath];
_selectedSubCellTxt = selectedCell.textLabel.text;
NSLog(@"SELECTED Sub Row %@", _selectedSubCellTxt);
[self performSegueWithIdentifier:@"123" sender:self];
}