uisearchdisplaycontroller

Reloading UITableView behind UISearchDisplayController

岁酱吖の 提交于 2020-01-01 02:28:49
问题 I've run into this really strange phenomenon that I can't quite figure out. I have a UITableViewController that manages a UITableView. Pretty simple. I also have a UISearchDisplayController for searching the contents of the table view. The searching functionality will be able to delete items of the content displayed by the table view. So if the user chooses to delete one of the items they found while searching, I want to not only reload the UISearchDisplayController's table view but also the

Hide UISearchBar Cancel Button

社会主义新天地 提交于 2019-12-29 18:49:09
问题 I have a UISearchDisplayController and UISearchBar hooked up to my ViewController via Outlets from my nib. I'd like to hide the cancel button so that the user never sees it. The problem is that the following code hides the button, but only after displaying it to the user for a millisecond (e.g., it flashes on the simulator and device and then disappears out of view). - (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller { controller.searchBar.showsCancelButton

iPhone SDK: Setting the size of UISearchDisplayController's table view

。_饼干妹妹 提交于 2019-12-29 04:18:26
问题 My app's table view does not occupy the full screen height, as I've allowed 50px at the bottom for a banner. When I begin typing in the search bar, the search results table view is larger; it fills all available screen space between the search bar and the tab bar. This means that the very last search result is obscured by the banner. How do I specify the size of the table view used by UISearchDisplayController? There's no bounds or frame property that I can see. EDIT TO ADD SCREENSHOTS: This

UISearchDisplayContoller – can't prevent table reload on typing in search bar

我们两清 提交于 2019-12-28 12:46:31
问题 I'm trying to set up a search display controller to handle async results from a web service. I've got the basic bits in place but have run into a really strange issue that I can't figure out. Seems like to rig up the search display controller for async you really just need to do two things: return NO for searchDisplayController:shouldReloadTableForSearchString, and handle searchBarSearchButtonClicked and fire off the table reload myself. I'm doing both of these but what I'm seeing is that the

How can I change strings of “Cancel” button, “No Results” label in UISearchBar of UISearchDisplayController?

醉酒当歌 提交于 2019-12-28 03:39:05
问题 How can I change strings of "Cancel" button, "No Results" label in UISearchBar of UISearchDisplayController? 回答1: I solved it myself. Cancel Button> (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller { [controller.searchBar setShowsCancelButton:YES animated:NO]; for (UIView *subview in [controller.searchBar subviews]) { if ([subview isKindOfClass:[UIButton class]]) { [(UIButton *)subview setTitle:@"_____" forState:UIControlStateNormal]; } } } No Results Text>

UISearchBar: FilterContentForSearchText not working on a UITableView (results not shown on table)

坚强是说给别人听的谎言 提交于 2019-12-25 06:22:27
问题 PROBLEM PARTLY SOLVED, SEE END OF POST: Showing search results on a UITableView not working. The table stays blank, doesn't show any results but the searching must work because when I search for something not in the table I get immediately "No Results" text shown on the table . Note: In IB I did connect the delegate of UISearchBar in Connection Inspector with my Controller . Hope you can help. m: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return

UITableViewController with UISearchDisplayController multiple selection sync

ε祈祈猫儿з 提交于 2019-12-25 06:19:13
问题 I'm trying to figure out the most elegant way of keeping row selection in sync between a UITableViewController and a UISearchDisplayController . When a row is selected in the UITableViewController I want the same row to appear as selected when the UISearchDisplayController is active , and vice versa. Both tableView objects have allowsMultipleSelection set to YES . 回答1: The basis of this technique was gleaned from Erica Sadun's very helpful book "The Core iOS 6 Developer's Cookbook" fourth

Stop UISearchDisplayController from showing empty cells

 ̄綄美尐妖づ 提交于 2019-12-25 04:53:11
问题 I've implemented a UISearchDisplayController on a fairly standard tableview (same datasource for table + search). The problem I am having is when the results don't fill the screen there are "pseudo" rows below the actual results. I was able to set the background color, but can't find a good way to suppress these rows/separators. They seem decoupled from my numberOfRowsInSection: delegate response. If I set the searchResultsTableView.separatorColor (green) it only changes the actual results

Is parsing XML on the main thread faster? Why?

情到浓时终转凉″ 提交于 2019-12-25 01:27:06
问题 I'm using LRResty and NSXMLRequest to display search results from an API. Here's what my code looks like: [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; [[LRResty client] get:searchEndpointURL withBlock:^(LRRestyResponse *response) { //NSLog(@"Results:\n\n\n%@", [response asString]); [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; NSXMLParser *parser = [[NSXMLParser alloc] initWithData:[response responseData]]; parser.delegate = self; /

Hide UISearchbar as header inside UITableview when cancel is touched

被刻印的时光 ゝ 提交于 2019-12-24 11:27:03
问题 I have integrated a UISearchDisplayController into my controller's xib. The basic functionality I'm going for is to have the search bar in the header of the table, and a button in the navigation bar that shows the search display. What I'm stuck on: When the cancel is touched, I want to make the searchbar invisible (keep the table so index 0 is show at top, not the search bar), but it stays visible and i'm not sure why (see 3rd image). Any ideas how to always keep the searchbar hidden when the