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

matthew858

macrumors member
Original poster
Apr 15, 2008
97
0
Sydney, Australia
Sorry if this has already been answered, but how do you add a search function to an iPhone app. I have made a brilliant app but need to add a search function so people can search for "items" within my app. Like the contacts search in iPhone 2.0.
 
Err, implement code to search through items?

There's nothing pre-written to generically "search" through some generic items - that would be hard to do such that it covered the greatly differing needs of developers based on the application.

As far as UI goes, though, you can use a UISearchBar. That's about as prewritten as you're gonna get. :p
 
How would I go about implementing a search function to sift through a large-ish SQL table I have? It's just a load of categories leading to pages with about 7 or 8 blocks of text on them.

[i r noob :(]
 
Look at the TableSearch example project. There is a new class in 3.0 called UISearchDisplayController that does some spiffy things during searching.

However that example project will mainly show you how to set up the UI. The way that you actually search through your data will be up to you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.