Reputation: 1813
in my app i need to save some data. Right now i use CoreData, i have an entity with 6 attributes. In my database there are around 40 objects of this entity.
So my question is, if it is better to save them in a plist? I don't have experience with performance of these two techniques but i think plist's are for smaller list of objects but it's faster and for CoreData it's the opposite.
What would u say?
Upvotes: 2
Views: 825
Reputation: 25632
CoreData, plist, or just keyed archiving - all will work.
CoreData has great features and performance, but they come at a cost: setting up will take some work, and changing the structure is possible but needs more thinking.
If your dataset is small and simple structured, I'd bypass CoreData. If it's potentially big and dependent on the user, the answer might be different. If the data is a small static set (i.e. not changing), then use the plist which is easy to edit and maintain (by the developer).
Upvotes: 2
Reputation: 723538
Actually, for large data stores, Core Data will be faster. Plists can't be loaded partially, so if you want to load anything at all you need to read in the entire store, and that means time wasted as well as unnecessarily high memory usage. Core Data, on the other hand, knows how to retrieve only the resources you need, when you need them.
In your case, just go with Core Data. The learning curve is steeper, but it's worth it.
Upvotes: 3