uisearchdisplaycontroller

How to search by both first name and last name

折月煮酒 提交于 2021-01-28 12:38:33
问题 I am doing a search screen (to search list of names) on my iphone app , where i need to search by both first name and last name say my search tableview contains names like follows Ravi Kiran sujay huilgol harry potter my search is working for only first name i.e if i search for Ra it ill show Ravi Kiran but when i search for Kiran its not displaying Ravi Kiran my filterContentForSearchText is like this - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { [self

UISearchDisplayController “No Results“和 cancel按...

我与影子孤独终老i 提交于 2020-04-17 04:26:06
【推荐阅读】微服务还能火多久?>>> 通过 查看UISearchDispalyController的delegate方法以及它本身属性 了解到他的一些方法,而通过测试,No Results字符的更改放到 - (void)searchDisplayController:(UISearchDisplayController *)controller willShowSearchResultsTableView:(UITableView *)tableView;方法中更为好一些,我看到有朋友放到shouldreload方法中的 不过第一次还是会显示NO Results 所以效果不好,但是我测试,delegate方法shouldreload方法是发生在willShowSearchResultsTableView之前的,但是为什么更改默认的ResultsTableView的resultlable属性,shouldreload第一次不会改变,第二次执行shouldreload的时候就会显示“无结果”。 但是如果你是在willShowSearchResultsTableView方法中更改的话,第一次就会显示效果。 一下是我写的 更改方法 - (void)searchDisplayController:(UISearchDisplayController *)controller

UISearchDisplayController—why does my search result view contain empty cells?

限于喜欢 提交于 2020-01-31 05:32:29
问题 I am about to go out of my mind here, in my Core Data databse I have a lot of users, i have hooked the database up to a tableviewcontroller via NSFetchedResultController, and when the view loads, I see all my users, and i can perform a push to a detail viewcontroller via storyboard segue... so far so god, my tableview contains a custom cell with an image view and 2 uitextlabels that all has their tag values assigned.. Now, when I perform the search I create a new NSFetchedResultController

UISearchDisplayController—why does my search result view contain empty cells?

怎甘沉沦 提交于 2020-01-31 05:31:32
问题 I am about to go out of my mind here, in my Core Data databse I have a lot of users, i have hooked the database up to a tableviewcontroller via NSFetchedResultController, and when the view loads, I see all my users, and i can perform a push to a detail viewcontroller via storyboard segue... so far so god, my tableview contains a custom cell with an image view and 2 uitextlabels that all has their tag values assigned.. Now, when I perform the search I create a new NSFetchedResultController

Where does filterContentForSearchText:scope: method come from?

心不动则不痛 提交于 2020-01-14 02:36:08
问题 Recently, I noticed that filterContentForSearchText:scope: appeared in multiple tutorials regarding how to implement a search bar. However, I looked up the references of both UISearchDisplayDelegate and UISearchBarDelegate . I found this filterContentForSearchText:scope: is neither a required nor an optional method. I wondered if filterContentForSearchText:scope: is just a conventional method name for filtering search results? 回答1: Yes, that is only convention for a common method called from

Getting notified when user presses “Search” on keyboard in UISearchDisplayController

时光怂恿深爱的人放手 提交于 2020-01-13 08:26:09
问题 I am using a UISearchDisplayController to let the user search through a list of buildings on a university campus. Sometimes, the user will know exactly what building they want, enter the building's number, and that building will then be the only building result showing in the UITableView. At the moment, if the user proceeds to hit "Search" on the keyboard, the keyboard animates off the screen and the user then has to make a second tap on the sole item in the UITableView to be sent to a point

SearchDisplayController search multiple arrays

*爱你&永不变心* 提交于 2020-01-11 12:45:06
问题 Currently I'm populating my tableviewcells with the contents of multiple arrays representing a name, id, etc. My question comes when I start to use the search display controller. I have an array with a list of names, a list of IDs, a list of barcodes, and a list of Aliases. When the user types in the search bar I need to be able to search all 4 arrays. When it finds the result in 1 array it has to pair the result with the 3 other arrays.. Example Names (apple,carrot,banana, dog) alias (red,

searchDisplayController deprecated in iOS 8

这一生的挚爱 提交于 2020-01-09 03:43:04
问题 How do you correct the following so no warnings appear? What am I missing? When correcting the searchResultsController to searchController it gives me an error "object not found" if (tableView == self.searchDisplayController.searchResultsTableView) { cell.textLabel.text = [searchResults objectAtIndex:indexPath.row]; } else { cell.textLabel.text = [_content objectAtIndex:indexPath.row]; } return cell; } -(BOOL)searchDisplayController:(UISearchDisplayController *)controller

SearchBar in Navigation Bar not working

蹲街弑〆低调 提交于 2020-01-06 15:18:43
问题 For reference, I'm running the below on an iPad with iOS 7.0.4. The vc is a presented modally as a form page. The search vc is the second vc on the navigation stack. My table is setup with a search bar and search display controller and is working fine with the search bar located in the header of the table. It returns search results just fine...see image: !http://www.mcartherstkd.com/images/search.png I make a one line code change in the vc's viewdidload method to move the search bar to the

IPhone Keyboard hides UISeachBar

左心房为你撑大大i 提交于 2020-01-05 04:08:15
问题 I have a search bar at the bottom of a view. The issue is whenever I type something in the keyboard, the search bar still remains at the bottom and I cannot view what I am typing. I would like to dynamically move it up whenever the keyboards pops up and then take back its original position after the keyboard disappears. And unfortunately the search bar has to be in the bottom for my app and kind of stuck in this. Is there any way around to move the search bar up only when the keyboard appears