uisearchdisplaycontroller

UISearchDisplayController not working when created in code?

丶灬走出姿态 提交于 2019-12-21 02:25:10
问题 I'm working on a tab bar application and one of the tabs has a UISearchDisplayController hooked up to a UISearchBar. It's all connected up in the NIB and is working. When I tap the search bar, the Scope and Cancel buttons fly in etc, and the search delegate updates the results table correctly. However, I'm trying to implement the same code in the viewDidLoad message instead of the NIB, however when I delete the search display controller from the NIB and uncomment my code to create the same

UISearchBar in a UITableView

梦想与她 提交于 2019-12-20 15:28:22
问题 I'm trying to mimic the behaviour of a table view similar to the iPod app for Artists - it's a sectioned table view with a section index on the right, with a search bar at the top, but initially hidden when view shown. I am using sdk 3.1.2 and IB, so simply dragged a UISearchDisplayController into my NIB - it wires everything up for searching. The problem starts because I'm adding the UISearchBar to the first section of the UITableView , because if I understand correctly I must do this so I

filterContentForSearchText and shouldReloadTableForSearchString not called (UITableView & UISearchBar)

陌路散爱 提交于 2019-12-20 03:12:30
问题 I'd like to implement an incremental search of words. I implemented like below, but filterContentForSearchText and shouldReloadTableForSearchString methods are not called. Why? WordsIndexViewController.h #import <UIKit/UIKit.h> @interface WordsIndexViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, UISearchDisplayDelegate, UISearchBarDelegate> @end WordsIndexViewController.m #import "WordsIndexViewController.h" #import "WordsShowViewController.h" #import "Word.h"

IOS7 Status bar change to black after search is active

随声附和 提交于 2019-12-18 14:56:04
问题 I'm using UISearchBar as header of UITableView. UISearchBar style is UISearchBarStyleMinimal. And when search is active, status bar change to black. How to fix that? Before search is active Search is active 回答1: you just need to do this: self.navigationController.view.backgroundColor = [UIColor lightGrayColor]; 来源: https://stackoverflow.com/questions/19129540/ios7-status-bar-change-to-black-after-search-is-active

iOS 7 UISearchDisplayController search bar disappears

放肆的年华 提交于 2019-12-18 11:56:10
问题 I was recently updating my app and came across this issue. When i start typing in the search bar the search bar disappears and i can only see the table view. I can still keep on typing and the table view gets updated but i cannot see the search bar. Same settings works fine on iOS < 7 Any idea why this is happening ? 回答1: A little late, but I've encounter the same problem just recently. I wanted the search bar to be visible and active through all of the search, so the dimmed view, which

UISearchDisplayController animate reloadData

狂风中的少年 提交于 2019-12-18 09:12:21
问题 I've been reading all the documentation about UISearchDisplayController and its delegate but I can't find any way to animate the table view when the search criteria change. I'm using these two methods : They both return YES but still can't find any way to do something similar to : I don't know if it's important but I'm using an NSfetchedResultsController to populate the UITableView in the UISearchDisplayController That's it thanks ! 回答1: When the search string or scope has changed, you assign

Deleting from UISearchController's filtered search results

大城市里の小女人 提交于 2019-12-18 05:46:10
问题 I have a tableView sourcing its cell content from CoreData and have been replacing the SearchDisplayController (deprecated) with the new SearchController . I am using the same tableView controller to present both the full list of objects and also the filtered/searched objects. I have managed to get the search/filtering working fine and can move from the filtered list to detail views for those items, then edit and save changes back successfully to the filtered tableView. My problem is swiping

How to keep scopebar even after pressed Cancel button?

蹲街弑〆低调 提交于 2019-12-17 20:26:38
问题 I have a UITableView with a searchbar on the top. I used UISearchDisplayController for implementing the same. And also it has a scope bar with two buttons. In default when I launch the app, the scope bar will be displayed. When I click the cancel button after the searching, the scopebar disappeared. So is there any way to keep the scopebar even after I pressed the Cancel button. I used the following code but its not working. - (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar {

UISearchBar animation issue

允我心安 提交于 2019-12-17 17:56:29
问题 I have a UIViewController in wich I want to show a tableview with the serchBar. As Simple as That: //viewDidLoad _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH(), SCREEN_HEIGHT()) style:UITableViewStylePlain]; _tableView.delegate = self; _tableView.dataSource = self; [self.view addSubview:_tableView]; // adding uisearch bar searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; _tableView.tableHeaderView = searchBar; //

Assertion failure when using UISearchDisplayController in UITableViewController

大城市里の小女人 提交于 2019-12-17 17:26:55
问题 I've been trying to add simple Search functionality to a TableViewController in my app. I followed Ray Wenderlich's tutorial. I have a tableView with some data, I added the search bar + display controller in storyboard, and then I have this code: #pragma mark - Table View - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BreedCell" forIndexPath:indexPath]; //Create