调用下面这个方法。
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
UITableViewCell *cell = (UITableViewCell *)[[textField superview] superview];
NSIndexPath *indexPath = [questionTableView indexPathForCell:cell];
NSLog(@"%d",indexPath.row);
}
就可以了。
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
UITableViewCell *cell = (UITableViewCell *)[[textField superview] superview];
NSIndexPath *indexPath = [questionTableView indexPathForCell:cell];
NSLog(@"%d",indexPath.row);
}
我在网上找的,试试这个