Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ShadoFlameX

macrumors newbie
Original poster
Jan 23, 2009
1
0
I'm experiencing some strange behavior when attempting to use a UITextField only in editing mode within a UITableViewCell. Basically what I'm trying to achieve is an editable textfield which only appears when you are in edit mode on the table. It would allow you to change the textfield value and hit done (and stop table editing) or clicking on another cell's textfield to edit a different cell and move that one centered into view. Currently, I am initing a Textfield during my cell's init method and then I set the cell.accessoryView equal to my textfield or to nil when the cell receives the setEditing call and based on the value of editing.

If I start editing, tap my textfield, change the value and hit done, everything works fine. However a bug occurs if I move the active textfield out of view and then hit done. The cell does not want to end the editing mode. This leaves the cell in a broken state and permanently in the editing mode. If I continue to repeat these steps with other cells they all become affected. Also, since my cells allow deletion, I can attempt to delete these affected cells and it will consistently crash the app after tapping the delete button. Also, please note that moving the cell out of view and typing on the keyboard does work and correctly add text to the field, so I know that it has a hold on the textfield.

Something is seriously flawed here, but I know this is possible as the Amazon app does exactly what I want to do (in the shopping cart view).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.