Skip to main content

Subclassing UISearchDisplayController For Abstraction



I have multiple UIViewController that have table views. I want these VCs to just handle UI stuff as they will all search the same database. I want to subclass UISearchDisplayController so I can have this subclass handle all the data and search stuff.





The VC I am working with is a UIViewController with a UITableView and a UISearchDisplayController . I have it set and can check to display the initial, or the searched data into the table view by using if/else statements like: if (tableView == self.searchDisplayController.searchResultsTableView) % else...





I want this custom subclass that I'm creating to handle the code that is executed in the self.searchDisplayController.searchResultsTableView statement so I can have some abstraction and can use this custom class with other VCs.





Any ideas on how to continue with this? I think I need to override some methods in the UISearchDisplayController .





EDIT:





Actually I may be coming into this wrong. I have it stepup the way I like right now, but there is no abstraction, so I can't really reuse this code in other parts of the app. My IB is setup like this: enter image description here


Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?