UISearchController with UITableView?

I want to create a UISearchController on my ViewController that contains a UITableView (not a UITableViewController). I have 2 warnings and a failure and are not sure if they are related, but I know that one of my problems is a warning

'Imcompatiable pointers types sending UITableView to parameter of type UIViewController.'

Obviously, because I'm trying to set searchResultsController to my tableView on my UIViewController, and not on the UITableViewController, for example:

   self.searchController = [[UISearchController alloc] initWithSearchResultsController:self.myTableView];

when self.myTableView is a UITableView, how can I fix it? Should I turn my TableView into a UITableViewController to get this working correctly? Thanks in advance.

+4
source share
1 answer

initWithSearchResultsController . , UIViewController, UITableViewController, ().

, , , tableView. , , -

self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil];

, , self.

+4

All Articles