Creating a search Database in Xcode for iOS

Discussion in 'iOS Programming' started by stevencapffa, Apr 14, 2014.

  1. stevencapffa macrumors newbie

    Apr 14, 2014
    I am trying to make a searchable database similar to the one in the picture i have attached. I am a novice at Xcode and trying to teach my self as a i go. Can anyone point me into the direction of how to write this code.I am writing this for IOS operating system

    App Example.png
  2. waterskier2007 macrumors 68000


    Jun 19, 2007
    Novi, MI
    Well you kind of need to provide some more information. Is this going to be a database stored on the iOS device?


    Core Data?
  3. stevencapffa thread starter macrumors newbie

    Apr 14, 2014
    More info

    I currently have all of the data in a spreadsheet file. Which ever method is easier i would like to start with. Either the data is stored within the app or on a external internet file. How easy is it to switch between the to in the future? Which is easier to program?
  4. mds1256 macrumors regular

    Apr 9, 2011
    Personally I would do it the following way but it is not easily achieved if you are a novice.

    Set up a MySQL database on a webserver somewhere (this allows you to quickly change content in the database without re-issuing the app.)

    Then use something like PHP to accept the query parameters from the app in a GET or POST method and use the PHP to query the MySQL database and return either XML or JSON (preferred) of the results.

    Then use the app to parse the returned XML or JSON data and populate a table view etc with the rows returned.

    There are a few different types of technology used here so you are better to get familiar with the way a web service works and how to use them with ios development.

    An even simpler way is to use, they have a framework which is really easy to implement and they take care of the database etc. You just populate the results and use their framework that has some really simple method calls which handles the network connections etc.
  5. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    There is a lot, seemingly, going on in that picture. I think you should explain in more detail what the functionality of this screen is, and what part of it you would like more help with.
  6. D.T. macrumors G3


    Sep 15, 2011
    Vilano Beach, FL
    I’m thinking - per some other comments above - that you’re going to want to use a remote service for the database. Unless it’s a really static set of data, and there’s little to no chance of it needing updating in a timely manner.

    I’d assume _most_ apps need data that’s easier to maintain than submitted new builds to Apple, and/or needs to be more up to date. Plus, by using a remote store, you open up your system design for web interfaces, other mobile clients, service interfaces to share with other system, etc.

    If you have a requirement of offline data access, that doesn’t mean you still wouldn’t want to use a remote store, it just means you’ll need to consider some kind of sync, i.e., fetching the remote data into a local store, and updating with whatever mechanism you want (manual, polling, lots of options).

    You potentially have a number of moving parts to this: the iOS app with some core network services, possibly authentication[?], all the “app basics” UI, layout, dealing with different devices, and whatnot - if you go with a remote service: some DB design, security, another language/framework (outside of Obj-C in the app itself).

    Are you sold on developing an App? If it’s some simple data access, and your idea, or business model is just to get it to users (i.e., you don’t need discovery, billing or other app/store related services), then it might be easier to just deploy to a web UI, wrap it up in some nice responsive UI, maybe use a JS template engine for consuming the service output.
  7. stevencapffa thread starter macrumors newbie

    Apr 14, 2014
    More Info 2

    Some of you guys, thou being very helpful, are making this a little more complicated. Basically what i want that is similar to the picture i posted is.
    -Have multiple search options
    -Example if i was making a database on dogs i can search what dogs have brown hair, and it would give me a list of all dogs that have brown hair
    -Example 2. I want to search what dogs have brown hair and are large.

    I don't mind sending in the app for updates i have it all in a database which is easier so i can just say upload my excel database to whatever Xcode database i need to.
  8. mds1256 macrumors regular

    Apr 9, 2011
    I wouldn't say any of the above comments are making it more complicated but for what you require you will need to make use of some kind of data store, whether it be a local/remote database or a NSDictionary object, it all still applies, you cannot simply add an excel document and expect it to work without creating some kind of query that accepts parameters from the different user interface objects. Where you store the data is up to you, personally mine would either be SQLite locally or MySQL on a remote server depending how often the data will change.
  9. stevencapffa, Apr 15, 2014
    Last edited: Apr 15, 2014

    stevencapffa thread starter macrumors newbie

    Apr 14, 2014
    Using the info i have figured out how to use MySQL and how to import my database. But i cannot figure out how to get my app to function like the one above. I don't know how to make a page look like those tabs and add a search button.

    Does anyone know any place i can find Good instructions, documentation, or instructional videos on Xcode for this area?
  10. mds1256 macrumors regular

    Apr 9, 2011
    Looks like you need to learn the basics of iOS development and xCode, from viewing basic tutorials you will be able to create a simple user interface like the one above.

    From the looks of it you will need a navigation controller to allow you to go back, a bar button item for the Search button and a table view that has a image, text and a picker controller.

    You will then need to create outlets from these to allow you to update the text as well as retrieve the text from the picker control for use in the search query.

    I would recommend for a very good iOS tutorial. This is how I started and have progressed massively since then. It is a good starting point which will teach you the basics of table views, pickers and navigation controllers.

Share This Page