SKSTableView icon indicating copy to clipboard operation
SKSTableView copied to clipboard

Selection cell issue - when first & second cell are expanded

Open LuaiKalkatawi opened this issue 10 years ago • 1 comments

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?

LuaiKalkatawi avatar Feb 20 '15 15:02 LuaiKalkatawi

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];
}

LuaiKalkatawi avatar Feb 20 '15 16:02 LuaiKalkatawi