Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

didSelectRowAtIndexPath and didSelectSubRowAtIndexPath ISSUE #26

Open
cancem111 opened this issue Feb 5, 2015 · 1 comment
Open

didSelectRowAtIndexPath and didSelectSubRowAtIndexPath ISSUE #26

cancem111 opened this issue Feb 5, 2015 · 1 comment

Comments

@cancem111
Copy link

First of all thanks for your hard and great work.

My first issue is once I click on the first expandable cell and then click on other cell its crash and I get this issue "unrecognized selector sent to instance 0x13f5618f0'" but if I click on other expandable cell's and again click on other cell's expandable or not it works fine. The only issue with the first cell.
It is only crashes when I add the code below with the first cell.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{   //Isn't this way to control if it is expandable or not?
  SKSTableViewCell *cell = (SKSTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
  if (cell.isExpandable) {
      NSLog(@"YES");
  }
  else{
      [self performSegueWithIdentifier:@"123" sender:self];
  }
}

My second issue is when the row expand and I select from the sub row I get the cell name instead of the sub row name.

- (void)tableView:(SKSTableView *)tableView didSelectSubRowAtIndexPath:(NSIndexPath *)indexPath
{
  UITableViewCell *selectedCell = [_tableView cellForRowAtIndexPath:indexPath];
  _selectedCellTxt = selectedCell.textLabel.text; 
  NSLog(@"SELECTED %@", _selectedCellTxt);
}

Please I hope you can help me with this?

@chika-kasymov
Copy link

Hello cancem111, I solved subrow selection by this sample of code:

UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:(indexPath.row + indexPath.subRow) inSection:indexPath.section]];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants