Segue after selecting a row filtered by the search display controller

Rush_CRush_C USMember, University

I have a Table View Controller with a search display controller embedded in it. I can type as you go in the Searchbar to filter my table data. Before I added the Search Display Controller, I placed a push segue from the tableview cell of my parent controller to the next view controller i.e whenever a row is selected, it navigates to the next view controller. However, after adding the search bar, when I click on any filtered row, it calls the RowSelect method but does not recognize the table view anymore and won't navigate to the next controller.

Without using search, this works just fine and moves on by using the segue added in the storyboard. But when I choose to use the search bar:

public override void RowSelected (UITableView tableView, NSIndexPath indexPath)

The first argument, tableView, shows that it is a: {<UISearchResultsTableView: 0x16fb1e00; frame = (0 0; 1024 768); ...etc.

I looked up some examples in Xcode and found that Xcode uses something like if (tableView == self.searchDisplayController.searchResultsTableView) to distinguish the parent controller's tableview from that of the Search Controller's. I need to be able to do something similar in Xamarin as well.

How can I access this tableview from the code? How can I make the segue work from the SearchResultsTableView?

I accidentally put the same question in a Discussion forum.

Sign In or Register to comment.