I changed the code of the Apple iOS TableSearch project to use it to search for a web service by analyzing its contents. Everything I implemented works fine except for one ugly detail when doing a search using the SearchDisplayController SearchBar. I changed the behavior of the SearchDisplayController to first call my search function when the Search button was clicked.
The problem is that when the search iteration (running in the background in NSOperationQueue) is completed, the "searchResultsTableView" (of searchDisplayController) is not automatically displayed or assigned to the received content. If you then change the text of the SearchBar or tap the "Cancel" button in the view that appears when you touch the search field (see TableSearch), the correct TableView appears with the search results. I just want this step to be executed immediately after the search operation is completed, so before you start interacting. At this point, the label โNo Resultsโ is currently displayed. The methods "filterContentForSearchText" and "shouldReloadTableForSearchString" do not change from the original TableSearch project.
I looked at various references to SearchDisplayController classes and its attributes, but have not yet found a final solution.
I tried the following in a section that definitely repeats after completing NSOperation, but it does not seem to solve the problem.
[self.searchDisplayController.searchResultsTableView removeFromSuperview]
and
self.searchDisplayController.searchResultsTableView.hidden = YES;
These operations have the correct form that I want to display. BUT scrolling is disabled until you change the state to hide the view again. However, you can select TableView items. I basically want it to be just scroll-enabled ...
Thanks in advance for your efforts!
source share