Find location of table view cell that calls view controller

Discussion in 'iOS Programming' started by moonman239, Nov 23, 2012.

  1. moonman239 macrumors 68000

    Mar 27, 2009
  2. ArtOfWarfare macrumors G3


    Nov 26, 2007
    You could set a variable in your tableView:didSelectRowAtIndexPath: method. I have to ask though: why do you need to know? What is it you're looking to do?
  3. Duncan C macrumors 6502a

    Duncan C

    Jan 21, 2008
    Northern Virginia
    By writing code.

    (My answer is about as clear as your question.)

    There are probably a dozen different ways to do what you describe. Which one makes sense depends on how your program is structured, if you're using storyboards or XIB files, how you represent your data model, etc, etc.

    Without a more complete picture, there's no way to provide meaningful help.
  4. MattInOz macrumors 68030


    Jan 19, 2006
    What method is the cell calling on the view controller in controller in question?

    Is the view controller a standard view controller, like a tableview controller?

    Is the Cell a standard tableviewCell or a custom subclass?

    A quicklook in the documentation for UITableviewController tells me there is no reason a standard cell would call back to the view controller. Also looking in the documents UITableview has the a number of methods for finding indexPath of a cell or alternatively a point in the tableview.

    The bigger question could why?
    What are you trying to do if you are trying to get the cells to respond to a gesture then there are ways to attach a gesture recogniser to the tableview make make it seem like its acting on the cells from the users perspective. A lot of the reasons for a cell to send a message back have easier more effective and more reliable ways of going about them.

Share This Page