Search code examples
iosuitableviewuiviewcontrollerresignfirstresponder

What executes textFieldDidBeginEditing on uitextfield within UITableCell


I have a UITextField inside a UITableViewCell (custom cell ).

I have 3 rows in my UITableView. the 2nd row is the text field row. The 3rd row is a link to open another view through an animation block.

The problem I have is if the user is editing the amount and clicks the 3rd row, to forwards to that screen, then when I dismissing this new viewcontroller, the screen goes back to the UITableview controller and fires textFieldDidBeginEditing.

How can I cancel this or avoid the user being sent back into the editing mode? I tried resigning in the table cell and the view controller and no luck.


Solution

  • You should end the editing of the textfield by calling [myTextField resignFirstResponder] when the third row is clicked.