objective-cxmluitextfield

Searching box from a list of XML


Using Objective C, and UITextField, I am trying to set a basic search engine.

So when user starts to type a word, he will get a list of words from an XML file (or other such as JSON), and as he continues typing, the list will be changed to adapt. Much like Google search box .

  1. I guess I don't have to invent the wheel and a searching algorithm from an XML file has already be done, but I couldn't find one .

  2. Regarding the UI elements needed, I guess a search box with a built in list is something that already there also ?


Solution

  • There are a bunch of tutorials online you should have a look at if you want to do this.

    Here are some about making a search:

    AppCoda Search Bar

    Ray Wenderlich Search View Swift

    Here are some about parsing XML and JSON:

    AppCoda JSON Parse

    AppCoda JSON & XML Tutorial

    Ray Wenderlich XML Parse

    I recommend that you read through these and other online documentation/tutorials and decide how you want to code your search engine.

    My advice for building this is to have a UITextField for the user to type into and then have a UITableView to display the results. You should parse the XML to a NSMutableDictionary/NSMutableArray and search using the user's input.