uisearchbar

NSPredicate omits special characters like á â á in filterContentForSearchText method

早过忘川 提交于 2019-12-31 04:06:05
问题 I am developing an app with an UISearchBar and I need to filter some names with special characters like à, è, ê and so on.. but if I don't type the correct string with the special character it doesn't appear. Ex: If I am looking for cómodo word I can't find this word if I don't type exactly có How could I get that word without type that special characters? for example typing just co . This is my NSPredicate : NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"SELF.word

iOS search bar not showing results

青春壹個敷衍的年華 提交于 2019-12-31 04:04:30
问题 *Update: This actually works, the style for my custom cell hasn't come across and so the cell looks blank. How then do I get the searchResultsTableView to use my custom cell? I have implemented a search bar in my table view. Searching, filtering all work when I debug, but when I enter characters into the search bar, the results do not load or show. This is everything I'm doing: @interface InviteTableViewController ()<UIAlertViewDelegate, UISearchBarDelegate, UISearchDisplayDelegate> @property

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

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>

Move SearchBar up when active

北慕城南 提交于 2019-12-25 19:01:27
问题 Currently I have a searchbar placed at the centre of my view. I was wondering if there was a way to have it move up to the top of the view when it's active and then move back when it's not. Any help? 回答1: Add the below KeyBoard observer notifications into ViewWillAppear [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector

UITableView Checkmarks at the wrong place after search

邮差的信 提交于 2019-12-25 18:36:33
问题 I want to search in my tableView, set checkmarks and save the objects with the checkmarks in Realm. But if I set a checkmark after a search and cancel the search, the checkmark is at the indexPath that I clicked on, and not at the object. I can't explain it better, so here's an example: After I search an exercise. After I clicked the cancel button Here's my code: class ShowExcercisesTableViewController: UITableViewController, UISearchResultsUpdating, UISearchBarDelegate { //Properties let

How to use UISearchBarController with array subsection

爷,独闯天下 提交于 2019-12-25 09:50:36
问题 I am using the following array structure to create a tableView with sections struct words { var sectionName : String! var coptic : [String]! var english : [String]! } var array = [words]() var filtered = [words]() array = [words(sectionName: "", coptic: [""], English: [""])] I want to utilize a searchcontroller using similar code to this func updateSearchResults(for searchController: UISearchController) { // If we haven't typed anything into the search bar then do not filter the results if

UISearchBar in a UIViewController crashing

£可爱£侵袭症+ 提交于 2019-12-25 08:52:34
问题 I am having a weird crash when using UISearchBar. I have a view controller on a storyboard and everything works fine but as soon as a drag a UISearchBar in the view controller and then run the app, I get the following crash: * thread #1: tid = 0x6d83b, 0x0462169e libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x0462169e libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x045ef2c5 libsystem_pthread.dylib`pthread_kill + 101

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