Reputation: 2653
I'm attempting to load and store (read AND write) a library of song information, and I don't know which method of storage would be more efficient. Initially I stored an NSArray that I'd created to a NSUserDefault, which allows for read/write access. However, after looking into how iTunes stores its library information, I've considered reading and writing from an XML file. Which would be easier to implement and more effective speed/memory usage wise? Any help would be greatly appreciated..
Upvotes: 0
Views: 778
Reputation: 9324
NSUserDefaults is ment just for preferences, not for saving a lot of data. NSUserDefaults are being saved in a plist (xml format, obviously) so there shouldn't be any difference in reading and writing speed. I would recommend you to save the information in a plist inside your documents folder. Aswell there is CoreData (which is saved as SQLite) or SQLite. Both of it is more difficult to implement than plists or NSUserDefaults.
Upvotes: 5
Reputation: 25001
You should consider using a SQLite database, or even better CoreData to manage your library information.
Upvotes: 4