如何通过特定的UITableViewCell获取原始indexPath.section?
- (NSString *)sectionForCell:(UITableViewCell *)cell {
//How to get the original indexPath.section by the specific UITableViewCell?
}
最佳答案
UITableView 有一个方法可以为您提供特定单元格的索引路径:
NSIndexPath *path = [self.tableView indexPathForCell:cell];
return path.section;
请注意,这将返回一个整数,而不是一个字符串。
关于objective-c - 如何获取特定 UITableViewCell 的节号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9445292/