uisearchdisplaycontroller

How do I use the UISearchBar and UISearchDisplayController

匆匆过客 提交于 2019-11-26 15:22:14
问题 I have an app which displays quite a lot of data in a UITableView . I already added the UISearchBar and UISearchDisplayController in Interface Builder to the UITableView . But I do not know how to use it. If someone could provide a quick solution to this, I would be grateful. I just require it to work as you type to find matches of the search query in the UITableView cells (or from an array). UPDATE 1 : Here's the code from the numberOfRowsInSection method: -(NSInteger)tableView:(UITableView

iOS 7 UISearchDisplayController search bar overlaps status bar while searching

你。 提交于 2019-11-26 15:09:47
问题 I'm updating my app for iOS 7, and I'm in the process of adjusting all my views to account for the new transparent status bar (my app will still use opaque navigation bars). It was relatively easy to adjust for the status bar in every view, except one major problem I'm having with a UISearchBar connected to a UISearchDisplayController in one of my view controllers. The search bar seems to display normally, as shown below: The problem is, as soon as I begin searching, the navigation bar

Prevent a UISearchDisplayController from hiding the navigation bar

守給你的承諾、 提交于 2019-11-26 07:18:01
问题 Whenever a user begins editing a UISearchDisplayController \'s search bar, the search controller becomes active and hides the view\'s navigation bar while presenting the search table view. Is it possible to prevent a UISearchDisplayController from hiding the navigation bar without reimplementing it? 回答1: The new UISearchController class introduced with iOS 8 has a property hidesNavigationBarDuringPresentation which you can set to false if you want to keep the navigation bar visible (by

How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar

橙三吉。 提交于 2019-11-26 00:38:55
问题 I\'m trying to implement search code in my CoreData-based iPhone app. I\'m not sure how to proceed. The app already has an NSFetchedResultsController with a predicate to retrieve the data for the primary TableView. I want to make sure I\'m on the right path before I change too much code. I\'m confused because so many of the examples are array-based instead of CoreData. Here are some questions: Do I need to have a second NSFetchedResultsController that retrieves only the matching items or can