searchdisplaycontroller

searchDisplayController, UITableView, Core Data and Swift

旧巷老猫 提交于 2019-12-29 08:08:57
问题 Trying to search in the table with searchDisplayController . Data filtering configured, the search dialog works. Now I want to work with a method prepareForSegue for send current value indexPath to a new UIViewController : import UIKit import CoreData class MainTableViewController: UITableViewController { var results:AddrBook[]=[] var searchResults:AddrBook[]=[] init(style: UITableViewStyle) { super.init(style: style) } init(coder aDecoder: NSCoder!) { super.init(coder: aDecoder) } override

iOS SearchDisplayController prevents tableview from background color change (background stays gray)

谁说胖子不能爱 提交于 2019-12-17 18:31:01
问题 This might be a bug in iOS 7: I used storyboard to drag in Search Bar and Search Display Controller in my tableview controller. The background color of my tableview is altered after that. I am using an example from AppCoda's "how-to-add-search-bar-uitableview" to demo this issue. I only changed the example code with 1-line add-on in ViewDidLoad : [_tableView setBackgroundColor:[UIColor blackColor]]; See my screenshots here: The bottom of the tableview has already changed to black: But the top

Proper instantiation of UISearchDisplayController

一笑奈何 提交于 2019-12-12 13:13:18
问题 I did some searching and the answer is still unclear to me. I am trying to create an instance of a UISearchDisplayController inside a TableViewController (TVC). In the header of my TVC, I declared a searchDisplayController as a property: @interface SDCSecondTableViewController : UITableViewController @property (nonatomic, strong) NSArray *productList; @property (nonatomic, strong) NSMutableArray *filteredProductList; @property (nonatomic, strong) UISearchDisplayController

prepareForSegue after UISearchDisplayController

此生再无相见时 提交于 2019-12-10 10:43:27
问题 EDIT: I just found: How to segue from a UISearchBarDisplayController result to a detailViewController which I'll take a look at! I'm combining a 'search bar and search display controller' with core data fetchedResultsController using storyboard. That is, I have to differentiate between: if (self.tableView == self.searchDisplayController.searchResultsTableView) { ... and the case where I've just listed the results fetched from the data store. However, I'm having trouble getting the right row

searchDisplayController: change the label “No Results”

我只是一个虾纸丫 提交于 2019-12-03 18:55:27
问题 how do I change the label "No Results", when using a searchDisplayController? Regards 回答1: It's not directly accessible, so you'll have to do it the old fashioned way and manually sift through the subviews of your searchDisplayController.searchResultsTableView . Here's one example: UITableView *tableView = self.searchDisplayController.searchResultsTableView; for( UIView *subview in tableView.subviews ) { if( [subview class] == [UILabel class] ) { UILabel *lbl = (UILabel*)subview; // sv

searchDisplayController: change the label “No Results”

拟墨画扇 提交于 2019-11-30 02:28:32
how do I change the label "No Results", when using a searchDisplayController? Regards drewh It's not directly accessible, so you'll have to do it the old fashioned way and manually sift through the subviews of your searchDisplayController.searchResultsTableView . Here's one example: UITableView *tableView = self.searchDisplayController.searchResultsTableView; for( UIView *subview in tableView.subviews ) { if( [subview class] == [UILabel class] ) { UILabel *lbl = (UILabel*)subview; // sv changed to subview. lbl.text = @"My custom string"; } } I wouldn't recommend this since you're relying on

UISearchDisplayController with no results tableView?

自古美人都是妖i 提交于 2019-11-29 18:48:45
Usually, a UISearchDisplayController, when activated, dims the tableView and focuses the searchBar. As soon as you enter text into the searchBar, it creates a searchResultsTableView that displays between the searchBar and the keyboard. The searchDisplayController's delegate gets called when this second UITableView is loaded/shown/hidden/unloaded. Usually it shows live search results or autocompletion entries while typing. In my app, I want to search a webservice and I don't want to call the webservice for each letter the user enters. Therefore, I want to entirely disable the

searchDisplayController, UITableView, Core Data and Swift

喜夏-厌秋 提交于 2019-11-29 12:07:05
Trying to search in the table with searchDisplayController . Data filtering configured, the search dialog works. Now I want to work with a method prepareForSegue for send current value indexPath to a new UIViewController : import UIKit import CoreData class MainTableViewController: UITableViewController { var results:AddrBook[]=[] var searchResults:AddrBook[]=[] init(style: UITableViewStyle) { super.init(style: style) } init(coder aDecoder: NSCoder!) { super.init(coder: aDecoder) } override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super

UISearchDisplayController with no results tableView?

与世无争的帅哥 提交于 2019-11-28 13:46:10
问题 Usually, a UISearchDisplayController, when activated, dims the tableView and focuses the searchBar. As soon as you enter text into the searchBar, it creates a searchResultsTableView that displays between the searchBar and the keyboard. The searchDisplayController's delegate gets called when this second UITableView is loaded/shown/hidden/unloaded. Usually it shows live search results or autocompletion entries while typing. In my app, I want to search a webservice and I don't want to call the

iOS SearchDisplayController prevents tableview from background color change (background stays gray)

喜欢而已 提交于 2019-11-28 07:52:41
This might be a bug in iOS 7: I used storyboard to drag in Search Bar and Search Display Controller in my tableview controller. The background color of my tableview is altered after that. I am using an example from AppCoda's "how-to-add-search-bar-uitableview" to demo this issue. I only changed the example code with 1-line add-on in ViewDidLoad : [_tableView setBackgroundColor:[UIColor blackColor]]; See my screenshots here: The bottom of the tableview has already changed to black: But the top stays as gray though tableview's background was set to black: This only happens when I drag in "Search