ios - UISearchController with UITableView? -
i'm looking create uisearchcontroller on viewcontroller contains uitableview (not uitableviewcontroller). having 2 warnings , crash, , unsure if they're related - know 1 of issues warning
'imcompatiable pointers types sending uitableview parameter of type uiviewcontroller.'
obviously it's because i'm trying set searchresultscontroller tableview on uiviewcontroller rather uitableviewcontroller so:
self.searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:self.mytableview];
with self.mytableview beingness uitableview, how go fixing this? have turn tableview uitableviewcontroller work right? in advance.
the initwithsearchresultscontroller method expects view controller. in experience, can either uiviewcontroller or uitableviewcontroller wherever want show filtered(searched) results.
in case, think, trying display filtered result in same view controller holds tableview. so, next should rid of error getting-
self.searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:nil];
however, have set datasource filtered table self.
ios objective-c iphone uitableview uisearchcontroller
No comments:
Post a Comment