点击tableview的一个cell时如何获取这个cell所在的组数和行数

2024-11-16 01:51:28
推荐回答(1个)
回答1:

The UITableViewDelegate will call

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
when a row is selected. From this you can easily determine the row by using indexPath.section and indexPath.row

If you haven't implemented a delegate (see nduplessis), UITableView also offers:

- (NSIndexPath *)indexPathForSelectedRow