In a UITableView
where the cells contain UITextField
objects, does having one of those UITextField
objects be the first responder prevent its cell from being re-used?
For example, with a UITableView
that has more rows than will fit on the screen, one can tap on a UITextField
to bring up the keyboard for the field in that cell. Then scroll the table view to make that cell go off screen. When scrolling back to the cell, I can see calls to -tableView:cellForRowAtIndexPath:
for all the cells, except the one that contains the UITextField
that currently has first responder status.
This behavior leads me to believe that iOS is aware that my cell contains the first responder and thus chooses not to discard the cell, thus not needing to call the data source to get the cell when it scrolls back into view.
This behavior is desirable, but I am concerned because I have not seen any documentation that indicates that this behavior is guaranteed, and I would hate to rely on it if there are conditions where it isn't true.
Can anyone point me at some documentation about table view cell re-use and first responders that covers this situation?
There is no such reference in the official iOS SDK documentation. You are correct to be concerned that this behavior you are observing is not guaranteed and should not be relied upon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With