Detecting touches outside TableView cells?

Discussion in 'iOS Programming' started by tsornin, Sep 28, 2008.

  1. tsornin macrumors newbie

    Joined:
    Jul 23, 2002
    #1
    I have a plain table view that only has one row to start with. I'd like the user to be able to touch anywhere on the screen (e.g., on one of the "empty" rows), at which point my app will create a new cell for them to edit. (Like the Notes app, although I don't really know if Notes is using a table view...) But so far I can't seem to detect touches outside of the one active cell. tableView:didSelectRowAtIndexPath: only works on the cell that's already there. I tried implementing UIResponder's touchesBegan:withEvent:, but that isn't being called either...
     
  2. tsornin thread starter macrumors newbie

    Joined:
    Jul 23, 2002
    #2
    Solved it. Had to create a custom UITableView class for my table view. Then implemented touchesBegan:withEvent: on that. Though it also needs to call [super touchesBegan:touches withEvent:event] in order for the table view to respond properly to cell selection, etc.
     

Share This Page