When a cell is scrolled out of view and is removed, uikit calls didenddisplayingcell. However, if that same cell has a uitextfield and the uitextfield is the first responder, didenddisplayingcell does not get called. If the user then taps a button to save the contents of all the cells and did not scroll the cell into the view, cellforrowatindexpath returns nil for that cell. How is it possible to identify when the cell is going to be hidden and removed from memory in this scenario?
Thank you for your suggestions. I do appreciate it. I discovered the kind of solution that I was looking for. I noticed in the UIScrollView class the property keyboardDismissMode. One of the values is UIScrollViewKeyboardDismissModeOnDrag. In interace builder, I set the property to dismiss the keyboard on drag in the tableview. This causes the UITextView to give up first responder and consequently didEndDisplayingCell is called. This is the perfect solution because when the cell was hiddin without this setting, characters could still be entered into the text field.
BTW, this problem exists for tableviews with static or dynamic cells. Cells scrolled off the screen are removed from the display in static mode.