Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

HawaiiMacAddict

macrumors 6502a
Original poster
Dec 28, 2006
904
0
On one of my Macs of course
Aloha everyone,

I'm trying to complete an iPhone app, but would like to tweak it just a bit to make it look more like an Apple app.

Here's my dilemma - I have a table view populated from a plist and have incorporated a searchbar that filters the results based on the letters typed, like in the Contacts app. I ran into a problem in that the keyboard wasn't released, so I coded it such that the searchbar resigned first responder when the Search button (bottom right) is clicked. Unfortunately, the resulting dataset (the sections containing the words that matched the user's entry in the searchbar) is what is displayed in the index on the right-hand side, not the complete index.

At this point, everything works - the search works, but if the Search button is pushed, the searchbar goes away - including the Cancel button. The user, once the Search button is pressed, has to either click in the top titlebar or scroll up to the top of the window, then click in the searchbar to once again be able to click on the Cancel button to get the entire index. I forgot to mention that I have chosen, via IB, not to show the cancel button by default.

I could, of course, choose to show the Cancel button all the time, but I would rather do it like in the Contacts app. Once the user clicks the Search button, only the keyboard slides away. When the app first starts, the Cancel button is now shown, as with my app, but when the user clicks the Cancel button in the Contacts app, the searchbar and the cancel button remain at the top of the screen. That's the action I would like to replicate.

I would like to request any and all responses to my call for assistance. As I mentioned above, everything is working up to specs, but I would like to request assistance in making it even better. Thanks in advance for any and all responses.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.