Favorites List.

Discussion in 'iOS Programming' started by sakthivadivel.a, Nov 30, 2011.

  1. sakthivadivel.a macrumors newbie

    Joined:
    Oct 31, 2011
    Location:
    chennai - -India
    #1
    Hi all,

    I am developing an application which is music oriented. My doubt is, if user wants to store (or) save, one (or) more files to favorites list means, which one of the following concepts best suits,

    1. using UserDefaults
    2. using Plist files
    3. using coredata
    4. using sqlite

    else, is there anything other than this. Kindly suggest.

    Regards
    sakthi
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    Without knowing more information, I'd say go with Core Data. Make sure you have the check box to use Core Data checked when you start your project, as it's very difficult and frustrating to add Core Data to a project after you've started it.
     
  3. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #3
    Actually, it's quite easy to add Core Data after you've already started a project, the thing is, you have to know what you are doing exactly at Core Data, or you're a tad fcked.
    And the endless dragging of SQLite vs Core Data too.
    Core Data IS SQLite.
    It's just an Objective-C Wrapper around it, it can also convert to Binary code to.
    And it's actually quite easy to maintain you're SQL with Core Data, it listens to changes on the objects etc.
    So i'd definitly go with something like that.
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    If the data of the list fits the constraints and you are not doing anything too complex with it, I suspect NSUserDefaults may be sufficient enough to store this info.
     
  5. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #5
    I have a favorites feature in my own app that was originally stored in NSUserDefaults. That worked fine for the first few versions of my app, until I decided I wanted to make the favorites feature a bit more extensive (IE, add shortcuts to each favorite.) To do this, I needed to move over to core data. Figuring out how to make my app upgrade old arrays from NSUserDefaults to new databases in Core Data took a while.

    To future proof your app and make it easier to add new features later on, I suggest just using Core Data from the start, even if it's more than you need right now for version 1.0 of your app.
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    If you build a proper model layer in your app, the details of how that model is stored are much less relevant and you should be able to alter the implementation without affecting any interfacing code. Such abstraction is a key concept of OOP.

    If you don't need or perceive a need in the foreseeable future that would lend itself to a Core Data solution, there's no need to over-complicate things. The KISS principle.
     

Share This Page