Reputation: 3230
How to get the original indexPath.section by the specific UITableViewCell?
- (NSString *)sectionForCell:(UITableViewCell *)cell {
//How to get the original indexPath.section by the specific UITableViewCell?
}
Upvotes: 2
Views: 6009
Reputation: 10129
Use the UITableView instance method:
- (NSIndexPath *)indexPathForCell:(UITableViewCell *)cell
Upvotes: 2
Reputation: 119242
UITableView has a method which gives you the index path of a particular cell:
NSIndexPath *path = [self.tableView indexPathForCell:cell];
return path.section;
Note that this would return an integer, not a string.
Upvotes: 6