Velocidad: XML frente a NSUserDefaults

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..

preguntado el 27 de agosto de 11 a las 15:08

2 Respuestas

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.

Respondido el 26 de diciembre de 11 a las 04:12

You should consider using a SQLite database, or even better CoreData to manage your library information.

Respondido 27 ago 11, 19:08

I agree, for reading and writing some kind of database solution is best. - Kendall Helmstetter Gelner

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.