iOS Favorites List.

sakthivadivel.a

macrumors newbie
Original poster
Oct 31, 2011
13
0
chennai - -India
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
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,704
4,331
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.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
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.
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
450
The Centennial State
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.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,704
4,331
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.
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.
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
450
The Centennial State
Figuring out how to make my app upgrade old arrays from NSUserDefaults to new databases in Core Data took a while.
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.

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.
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.