Closed cnzlh closed 9 years ago
I figured out this problem , the following code use ronail's pullRequest.Thx https://github.com/ronail/SKSTableView/commit/041bcf8e37bab2fd25160bca4a6f8004905598a1
(NSIndexPath ) indexPathFromSubrowIndexPath:(NSIndexPath )indexPath { block NSIndexPath *correspondingIndexPath = nil; block NSInteger expandedSubrows = 0;
NSArray rows = self.expandableCells[@(indexPath.section)]; [rows enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL stop) { if (idx < indexPath.row) { BOOL isExpanded = [obj[kIsExpandedKey] boolValue]; NSInteger numberOfSubrows = 0; if (isExpanded) { numberOfSubrows = [obj[kSubrowsKey] integerValue]; }
expandedSubrows += numberOfSubrows;
}
else
{
correspondingIndexPath = [NSIndexPath indexPathForRow:idx + expandedSubrows + indexPath.subRow //+ 1 /* 1 for main row */
inSection:indexPath.section];
*stop = YES;
}
}];
return correspondingIndexPath; }
This is awesome, please integrate with the original code, It is very helpful
(void)tableView:(SKSTableView )tableView didSelectSubRowAtIndexPath:(NSIndexPath )indexPath { MyCustomCell cell = (MyCustomCell )[tableView cellForRowAtIndexPath:indexPath]; NSLog(@"%@",NSStringFromClass([cell class]));
[cell customMethod];
}
However the cell Calss is SKSTableViewCell . can anyone help me?