How to get cell indexpath in uitextfield Delegate Methods?

后端 未结 11 1000
南旧
南旧 2020-12-08 22:56

I have two textfields in a custom cell how to get the indexpath value of Tableview cell in textfield delegate methods I want to get the input value from user and save it to

11条回答
  •  鱼传尺愫
    2020-12-08 23:12

    Try this method to get textfield dynamically anywhere from your tableview controller

     #pragma mark - Get textfield indexpath
    - (NSIndexPath *)TextFieldIndexpath:(UITextField *)textField
    {
        CGPoint point = [textField.superview convertPoint:textField.frame.origin toView:self.TblView];
        NSIndexPath * indexPath = [self.TblView indexPathForRowAtPoint:point];
        NSLog(@"Indexpath = %@", indexPath);
        return indexPath;
    }
    

提交回复
热议问题