Leo*_*ang 2 objective-c uikit ios4 ios
如何通过特定的UITableViewCell获取原始的indexPath.section?
- (NSString *)sectionForCell:(UITableViewCell *)cell {
//How to get the original indexPath.section by the specific UITableViewCell?
}
Run Code Online (Sandbox Code Playgroud)
UITableView有一个方法,它为您提供特定单元格的索引路径:
NSIndexPath *path = [self.tableView indexPathForCell:cell];
return path.section;
Run Code Online (Sandbox Code Playgroud)
请注意,这将返回一个整数,而不是一个字符串.
| 归档时间: |
|
| 查看次数: |
5935 次 |
| 最近记录: |