// 获取indexPath
NSIndexPath *indexPath = [tableView indexPathForCell:cell];
// 选中了cell,没法触发代理选中cell的方法
[tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
// 手动触发tableView的delegate方法[ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath ]
[self tableView:tableView didSelectRowAtIndexPath:indexPath];
【iOS开发】通过cell获取indexPath
最新推荐文章于 2019-02-28 14:06:56 发布