UITextField nested inside UITableViewCell problems -- solved

Discussion in 'Mac Programming' started by lucasgladding, Jul 14, 2008.

  1. lucasgladding macrumors 6502

    Joined:
    Feb 16, 2007
    Location:
    Waterloo, Ontario
    #1
    Has anyone had problems with UITextFields nested inside UITableViewCells? Specifically, the field does not track touch movements for changing the insertion point. If I move my finger down before dragging left or right, the events are tracked they should be. If moved left or right first, the cursor (and magnifying glass) freezes and disappears only if I touch somewhere else on the screen.

    If anyone has any advice for debugging the problem, help would be greatly appreciated.

    Thanks in advance
     
  2. lucasgladding thread starter macrumors 6502

    Joined:
    Feb 16, 2007
    Location:
    Waterloo, Ontario
    #2
    In case anyone else experiences the problem, it is caused by the UITableView. The UIScrollView class is somehow interfering with the moved events. The UICatalog example disables scrolling on the UITableView containing the UITextFields. Beside the tableView.scrollEnabled = NO line is the note:

    "no scrolling in this case, we don't want to interfere with touch events on edit fields"

    I hope this helps at least one other developer. I don't recall seeing mention of this issue in any release notes and didn't notice the comment until my 5th or 6th time through the UICatalog example.
     
  3. sdarlington macrumors newbie

    Joined:
    Sep 4, 2008
    Location:
    UK
    #3
    Unfortunately this didn't work on later versions of the SDK (though the problem still persists, even in Apple's sample code). The solution I found is to set the table's editable property to YES. Took me a couple of weeks to track this down! See here for more details.
     

Share This Page