When searching in uitableview, the indexpath of the selected cell is always null

Discussion in 'iOS Programming' started by zacattac50, Apr 5, 2014.

  1. zacattac50 macrumors newbie

    Joined:
    Dec 12, 2013
    #1
    Hello,

    I've been stuck on this issue for a couple weeks and haven't been able to resolve it. I have an app that has a drink dictionary that is searchable. The app works perfectly fine for selecting a drink normally and the search appears to work great in terms of filtering. However, when you search for a drink and then select one from the search results, it always automatically chooses the first item in the list because the indexpath in the didSelectRowAtIndexPath method always is null.

    Here is a link to a stackoverflow post I made about it that has my code.
    http://stackoverflow.com/questions/...idselectrowatindexpath-method-when-search-bar

    Thank you for looking and I would appreciate any help.
     
  2. zacattac50 thread starter macrumors newbie

    Joined:
    Dec 12, 2013
    #2
    Looking at this closer, it looks like the main source of my problem is that somewhere between filtering and the selection of a cell, I am losing reference to the SearchTableView. When the didSelectRow method is called, the tableview parameter that is passed in is not of type SearchTableView. Where am I losing it and how do I make it persist?
     

Share This Page