Iphone UISearchBar Cancel Button Malfunction - iphone

I have a UISearchBar that searches and displays results successfully. If I press the cancel button mid-search, the original table is restored and all is well. If I press the search button that is on the keyboard, the search results are shown, which is great. But THEN if I press the cancel button that is on the search bar (I am using the 'search bar and display controller'), the screen goes back to normal, leaving behind only the search results and not showing the original table.
Any ideas?
Thank you!

I got it - I did not know where I could interact with the cancel button that was built into the search bar but I put code that cleaned out the search table in the -searchButtonPressed and threw that in under the search did its work!

Related

react-infinite-scroll-component call next once I click on search button

I have react-infinite-scroll-component with my table result and I have also a filter to do a search. My issue is once I scroll a little and hit the search button, search call is triggered by both search button and infinite scroll next
I'm using version 6.1.0 react-infinite-scroll-component

Softkeyboard's "check" button vs using .unfocus()

In this video I first click on a field within the first tab, then click the soft keyboard's "check" button. This hides the soft keyboard and takes the focus away from that field. I then navigate across tabs and back to the first. No field has the focus at this point. This is the expected behavior.
In the second iteration, I click in the notes field. Without closing the soft keyboard, I then click the submit button. That button calls FocusScope.of(context).unfocus(); which hides the soft keyboard and takes the focus away from the notes field (the teal border disappears). However, at this point I click on the next tab and the soft keyboard reappears. And when I click back the first tab the notes field once again has the focus.
Why does this happen?
What underlying code does the "check button" on the keyboard call and can I wire this up to the button rater than calling the .unfocus() method to get the expected result?
Edit: Still no explanation. The undesirable persistent keyboard does not occur on iOS.

XCode 10 adding action to button

I'm trying to make a Cocoa app with buttons that run simple command line scripts.
I can't seem to figure out how to add the action to my button.
I've read some docs that suggest holding down option and dragging the button into controller code but I think they are out of date. Can someone suggest how to get there from this screenshot?
You need to first select your button, then hold the control ⌃ button on your keyboard and then drag that across to your view controller. That will then give you the option of what to name your method etc.
Actually I had the same problem and the root cause was just the drag method. From the descriptions I had assumed that I need to press CTL and then drag while having the left mouse button pressed. This did not work at all (in my environment). Then I noticed that "it works" with the right mouse button. But the result was not correct. (E.g. I could not get "Action"). Finally I found: I have to use the right mouse button only for dragging without holding CTL. Then I got the correct result.

UISearchBar - what is "search results button" for?

(Duplicate of this question, but I figured I could try again, since that one wasn't answered...)
The UISearchBar on the iPhone has an option showsSearchResultsButton. When you turn it on, it shows a button with horizontal lines inside the search bar, and you can implement a callback that will be called when the user presses it.
The thing is, I can't find a single place on the Internet where it says what the intended purpose of this button is. I know I could make it do anything, but I'd like to know what it's actually for. Should it show a history of searches, or all items without filtering, or what?
It's simply to show search results when tapped.
Where Apple uses this is in their iPad App Store application. If you go to the Categories tab you'll see various app categories. Search for an item, you'll get a list of results, and when you press "Done" you are shown the categories screen again. Your previous search term is still listed in the search field, but now the Search Results Button appears in the field. After tapping this, a UIPopOver is displayed, showing a text list of the results from your last search.

How to resize the search bar so that the index doesn't overlap

I've been browsing stack overflow and can't find a simple newbie-level explanation for this. I have the following behaviour. When the user clicks the search the index is removed and a cancel button appears next to the search bar. When cancel is pressed, the cancel button is removed and the index reappears.
Does anyone know a simple way to reduce the width of the search bar (text field) by 20-30 pixels on the right. This is the way the contacts app deals with this overlay.
Any help gratefully appreciated. I've built the view in a xib file.