I have a grouped table view and trying to set a new first responder to a text field when the user hits enter.
This is nothing new to me, and my code worked before I made
First off, I would absolutely verify that your description above that your code "worked before" and the changes are "unrelated". Any changes you made to working code, by definition, in some way contributed to it not working any longer. If not directly, then indirectly due to a side effect.
All that jumps out at me from your posted code sample is the line:
// adjust the table view offset to make sure the text field is visble
[self setTableViewOffsetForTextField:field];
You are doing the right thing ensuring that that the cell containing the textField is scrolled into view. One possibility is that the cell is created when you scroll it into view which, depending on the rest of your code, may cause issues such as:
the textField you are sending becomeFirstResponder
to is a different instance than the textField actually in the cell.
the cell hasn't been created yet when you call becomeFirstResponder
due to animating scrolling the cell with the textField into view.
I would back out any changes you made to go back to a working version and really ensure the correct textField is being sent becomeFirstResponder
at an expected time.