I have an app that reads JSON into in-memory objects. I have one object representing the User and then an array of custom objects. This array is ususally 20-50 objects but can be up to 7-800 in rare cases.
I've read some threads about this, but find it hard to pick, since all i want to do is cache this locally, nothing more, so that i can fetch less from the server.
I can see three solutions:
NSUserDefaults. Not sure how app performance is affected by large array
CoreData / MagicalRecord. Seems nice but a bit complicated
Plist with NSCoding/Decoding
Custom solution.
I am leaning towards NSUserDefaults or Plist since it seems easiest, and i only want to read to and from memory when the app starts/exists. However, is there any issue i should know about, like performance or app startup time when storing so many objects? Is there other reasons for using MagicalRecord?
Pointers much appreciated.
EDIT: Added the plist/NSCoding choice, had forgotten.
Good day, my friend, U have a good question let's understand that it is better to use:
NSUserDefaults - usually use for example for definition of some Settings, Accounts, whether definitions the application, generally a global variable for easy storage and access to data was opened
Plist - Small amount of data that do not need complex query, editing not a large number of fields is suitable for storage also, The matter is that arrays and dictionaries at serialization in a plist are passed recursively, that is, only one more level of an enclosure on each massif or the dictionary in other container turns out. From here also restrictions on contents follow: only the types which are giving in to serialization.
Coredata/SQLite - Big amount of data which need Structured Query, I think, you have to ask the question "why I shouldn't use Coredata here" first of all. And having a little understood you will understand that the Coredata is ideally suited for storage of any types and volumes of data.
MagicalRecord - library for simplification of work with core data, its advantages(Clean up my Core Data related code, Allow for clear, simple, one-line fetches,Still allow the modification of the NSFetchRequest when request optimizations are needed) I don't recommend to use if you don't understand as the Coredata works
RESULT : If in fact you need to store some key value and you don't want to bother with knowledge of core data and you have no time for studying, use plist for your data. If you want to store something more difficult and more volume - only coredata. I personally recommend to use coredata, you are convinced that it is easy and convenient, it is necessary to spend time only.