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

zacattac50

macrumors newbie
Original poster
Dec 12, 2013
6
0
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.
 
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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.