indexpath获取cell

UITableViewCell *cell = (UITableViewCell *)[btn superview];

NSIndexPath *indexPath = [_myTableView indexPathForCell:cell];

NSLog(@"indexPath is = %i",indexPath.row);




UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

MyCustomCell *cell = (MyCustomCell *)[tableView cellForRowAtIndexPath:indexPath];

你可能感兴趣的:(indexpath获取cell)