Best Data Storage Method

Discussion in 'iOS Programming' started by Cergman, Jul 27, 2014.

  1. Cergman macrumors 6502a


    Jan 1, 2013
    my tesla
    I'm developing an update to one of my current apps, and I feel the data storage isn't the most efficient. I am currently using plists to store the user's information, but I feel like I should probably move to something more robust. What storage method would you guys recommend for my app? A user can add as many entries as they want, and each entry stores two integers and a string. Thank you!
  2. JohnsonK macrumors regular

    Mar 6, 2014
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    The choices would seem to be sqlite or core data.

    How many rows do you think are possible for a user to make? 100, 1000, 10000?
  4. Mascots macrumors 68000


    Sep 5, 2009
    Core Data

    If you're storing information that requires a database, you should use Core Data. It's not only a powerful abstraction, but it ties directly into many APIs that Apple provides (NSFetchedResultController, iCloud Core Data).

    If you're storing things like preferences, user defaults should suffice.
  5. Cergman thread starter macrumors 6502a


    Jan 1, 2013
    my tesla
    It would be highly unlikely for the user to enter more than 10 rows. I've heard core data has a steep learning curve, is that true?

    Edit: also this is an iOS app
  6. TheWatchfulOne macrumors 6502


    Jun 19, 2009
    Core Data does have a steep learning curve, but I'm sure it would be worth learning. It has lots of goodies built-in.

    On the other hand, interacting directly with SQLite might have a steep learning curve too. That's the approach I'm using in my current project, but then I have no problem writing SQL statements.

    plists are probably the easiest way to read and write data, but they don't scale. Whenever you want to change one value in a plist, the whole list gets re-written.
  7. MattInOz macrumors 68030


    Jan 19, 2006
    #7 is a new option.

    Only just started looking at it for a project but does look promising.
    It's certainly a lot more direct in terms of code than Core Data, as the data model is defined in classes.

Share This Page