Welcome, Guest
Username Password: Remember me

UISearchBar Search Button
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: UISearchBar Search Button

UISearchBar Search Button 1 year, 5 months ago #1

Hi,

I've attempted to have my delegate respond to searchBarSearchButtonClicked, but it's not working.

It's probably because when I set the searchBar property of my tableModel to my searchBar outlet, STV is taking over delegate duties.

So that begs the question: How do you react to the Search button? I have the type-ahead working and the Cancel button works, but the Search button does nothing. Since the type-ahead has effectively already searched and hopefully found what you're looking for, the Search button should basically just resignFirstResponder and put the keyboard away. This is especially important if there are a lot of search results and you don't want to have to scroll through your table with the keyboard showing.

Further to that, is it possible to use the UISearchBarDisplayController instead of just a UISearchBar? I'd like to provide the same kind of type-ahead searching as done in the Contact app. In that case, the UINavigationBar is pushed up out of the way and the search bar goes in its place until you dismiss the keyboard.

I tried wiring up my SCTableViewModel to the UISearchBarDisplayController's searchBar instance, but SCT didn't pick up on that.

Thanks,

Brendan
  • tapforms
  • OFFLINE
  • Expert Boarder
  • Posts: 120
  • Karma: 4
Thanks!
Brendan
www.tapforms.com

Re: UISearchBar Search Button 1 year, 5 months ago #2

Hi Brendan,

We've actually added all these UISearchBar delegate methods under the SCTableViewModelDelegate protocol. I'll send you our latest update now.

Regarding your UISearchBarDisplayController, is it just the navigation bar disappearing effect that you require?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: UISearchBar Search Button 1 year, 5 months ago #3

tarek,

I also could use that update.

Thanks,

Bill
  • bill
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0

Re: UISearchBar Search Button 1 year, 5 months ago #4

Hello Tarek,

The update worked great. Thanks!

There are two aspects to the UISearchDisplayComponent that I need. Yes, one is the hiding of the navigation bar. The other is the ability to perform asynchronous searches as the user types. I need to search an online database of over 80,000 manufacturers. It's too much data to download to do in-memory filtering, so I'm going to try to implement searching against our web service asynchronously. USearchDisplayDelegate provides a method searchDisplayController:shouldReloadTableForSearchString: which I believe is where you would kick off an asynchronous search. Then update the table view in the search results.

Is there a way to accomplish the same thing with STV? I won't be loading in all 80,000 manufacturers to search through in memory.

Thanks,

Brendan
  • tapforms
  • OFFLINE
  • Expert Boarder
  • Posts: 120
  • Karma: 4
Thanks!
Brendan
www.tapforms.com

Re: UISearchBar Search Button 1 year, 5 months ago #5

We're currently implementing a delegate that will enable you to provide your own custom results as the user types in their search (as an NSArray of strings). Does this fully satisfy your requirements?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: UISearchBar Search Button 1 year, 5 months ago #6

The results would have to be an NSArray of NSString? I will need to be able to get an NSArray of NSObject. Since in my situation I'm fetching Manufacturer objects which have a name, an ID and a logo URL. Basically when I fetch from my web service, I get a plist which I decode and then marshal into an NSArray of STIManufacturer objects. So from that point on I'm dealing with an STIManufacturer entity object.

Thanks,

Brendan
  • tapforms
  • OFFLINE
  • Expert Boarder
  • Posts: 120
  • Karma: 4
Thanks!
Brendan
www.tapforms.com
  • Page:
  • 1
  • 2
Time to create page: 1.05 seconds