uisearchdisplaycontroller

NSCompoundPredicate

时光总嘲笑我的痴心妄想 提交于 2019-12-23 09:43:12
问题 I'm trying to filter a UITableView's data using a UISearchDisplayController and NSCompoundPredicate . I have a custom cell with 3 UILabels that I want to all be filtered within the search, hence the NSCompoundPredicate . // Filter the array using NSPredicate(s) NSPredicate *predicateName = [NSPredicate predicateWithFormat:@"SELF.productName contains[c] %@", searchText]; NSPredicate *predicateManufacturer = [NSPredicate predicateWithFormat:@"SELF.productManufacturer contains[c] %@", searchText

Getting “Assertion failure” in UISearchResultsTableView

假装没事ソ 提交于 2019-12-23 04:37:06
问题 I'm getting the following error when i start type the search text in SearchBar Assertion failure in -[UISearchResultsTableView _configureCellForDisplay:forIndexPath:] My cellForRowAtIndexPath code for Search Display Controller is as follows : if(tableView == self.searchDisplayController.searchResultsTableView) { static NSString *CellIdentifier = @"cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell == nil) { cell = [tableView

Custom class for UISearchDisplayController's table view

a 夏天 提交于 2019-12-23 02:45:46
问题 I need to make the table view inside the UISearchDisplayController class to be a custom class which extends from UITableView . I'm using this pod: https://github.com/OliverLetterer/SLExpandableTableView, but I can't seem to make it work when using a UISearchBar and search results. The class I want use for the table view it's called SLExpandableTableView and it has several methods and properties which makes subrows work. Thanks in advance. 回答1: Not sure that's possible. I believe the problem

Adding UISegmentedControl in UISearchDisplayController

点点圈 提交于 2019-12-23 02:38:39
问题 I want to add the UISegmentedControl below the searchBar and above the TableView of UISearchDisplayController . Currently UISearchDisplayController only shows its tableView under its SearchBar . But i want to add a UISegmentedControl below the SearchBar so that I have SearchBar on the top, after SearchBar I have a UISegmentedControl and below that UISegmentedControl I have UITableView . Is that any way to do this using UISearchDisplayController or i have to make my own SearchDisplayController

Hide UITableView search bar

点点圈 提交于 2019-12-22 10:34:50
问题 I have a UITableViewController with a UISearchDisplayController setup in the standard way (with the search bar inside the tableView). I'd like the search bar to start out hidden - really hidden, not merely scrolled away as in this solution. Then I'd like to present the search UI when the user presses a button, and hide it again (really hide it) after the user selects one of the items found in the search. Here's the almost working code for that: - (void)viewWillAppear:(BOOL)animated { [super

How to Search Array of Dictionary and show in UITableview?

末鹿安然 提交于 2019-12-22 08:34:37
问题 I am pretty new in IOS and I am using UISearchDisplayController for searching. -(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { [self filterContentForSearchText:searchString scope:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]]; return YES; } - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*

Programmatically activating UISearchBar blocks user interactions with it

僤鯓⒐⒋嵵緔 提交于 2019-12-21 20:50:30
问题 I have a simple table view inside a navigation controller with the toolbar visible. On the toolbar is a search button, and the table view's table header view is set to my UISearchBar . If I scroll the table view up and then tap on the search bar to activate it, everything happens normally. But if I tap on the search button, which activates search bar programmatically, then all interactions with the search bar are disabled (looks like it's blocked by something), and the user can't clear the

UISearchBar with UISearchDisplayController animates outside screen

六眼飞鱼酱① 提交于 2019-12-21 06:06:08
问题 I have standard iPad view controller which has a custom navigation bar at the top. In the xib-file I've added a UISearchBar aligned to the right edge of the view. The search bar is 320px in width. I init a searchdisplaycontroller like this: // Search display controller self.mySearchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:_searchBar contentsController:self]; _mySearchDisplayController.delegate = self; _mySearchDisplayController.searchResultsDataSource = self;

Focus on the UISearchBar but the keyboard not appear

有些话、适合烂在心里 提交于 2019-12-21 04:03:51
问题 I've read so many solution on how can i focus a searchbar to make keyboard appear when i open my search view, and all of that are like this [searchBar becomeFirstResponder]; mine is [self.searchDisplayController.searchBar becomeFirstResponder]; but I tried both. Now, I tried this, and I also added a [self.searchDisplayController setActive:YES]; because I'm using a SearchDisplayController, but so far the best result i can have is to have the cursor on the searchbar, the uitableview with an

UISearchController doesn't hide view when pushed

℡╲_俬逩灬. 提交于 2019-12-21 03:41:04
问题 I am using UISearchController to display a search bar and results within a UITableView. I managed to set it up correctly, but when I search the results and then select one of the rows in the tableview, and push a new view controller to the navigation stack, I would expect the search bar to not be visible anymore. However, when I try this, the search bar from the first view controller is visible in the 2nd view controller: if (self.searchController == nil) { self.searchController = [