Persistent Database in Xcode

Discussion in 'iOS Programming' started by Sendaii, Feb 22, 2013.

  1. Sendaii macrumors member

    Joined:
    Jun 10, 2011
    #1
    I'm having a hard time trying to figure out what I need to learn/research to order to have a persistent information in a database, locally, for an iPhone app. The basic concept is a directory, with names, numbers, email addresses, blah blah blah. It would be around 50-75 entries. And none of this data I would want updated and deleted from the application.

    What are some of your suggestions on routes I should take? I am unsure if I should have the contents online and have it pulled from the web, or store everything locally. I like the idea of all the information being stored locally but it could add up data-wise but at least it would be available anywhere and anytime.

    Thoughts and suggestions are welcome :)
     
  2. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #2
    50-70 entries sounds extremely light unless each entry is a DNA chain.

    Downloading it over the net sounds a bit hardcore for such a thing unless
    you specifically want to learn that, or wasting time is an extreme sport for you!

    If it was never edited I'd be doing it myself.
    That sort of thing could be a simple text file bundled with the application.

    Is this your first App?
     
  3. MattInOz macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #3
    Well if the data isn't changed except for Updates then core data is probably over kill.

    Have a look at AddressBook API's which is a C style API and while it's mostly used to access the device addressbook you can use it with a private directory. You can have it read in data from vCard format.

    Maybe you could even by pass that and just direct load vCard files.
     
  4. Sendaii thread starter macrumors member

    Joined:
    Jun 10, 2011
    #4
    I suppose this is my first "real" app.

    I suppose with that amount of data it would be very light. I eventually want to learn all the different storage methods but for now, I need to pick one and learn that :)

    I'll have to do some research about the text files, because I'm not 100% sure how to go about doing that on the detailview screen itself, for all those.

    Thanks for the help, I appreciate it.
     
  5. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #5
    Your options are varied. You could use sqlite directly, you could use Core Data, or you could use a simple property list file, or you could store the data in an XML file or JSON file and parse that (under the covers, Core Data can be configured to save it's data as sql, XML, or a property list.)

    Honestly, for less than 100 static records I'd just use a plist. Quick and dirty.
     
  6. iJustinCabral macrumors member

    iJustinCabral

    Joined:
    Jul 8, 2012
    #6
    I would go with Core Data.

    Core Data form a far looks really confusing, but once you go through a few tutorials you'll get the main idea & concept behind it.

    Give it a shot, learning Core Data is a great asset for bigger apps you might want to make later down the road.


    Good luck!
     

Share This Page