views:

32

answers:

1

Hi all,

I want to cache my loaded data so that I can reduce my application start time .

I know several strategies to store application data

i.e. core data, nsuserdefaults , archiving .

Now my scenario is that suppose that I have array of maximum 10 objects each object having 5 fields .

So I can not decide which strategy to store this array an later retrieving the same .

Thanks .

+2  A: 

Never store cache data in NSUserDefaults; that is not what it is for.

Archiving is expensive and should not be used. It is also far more difficult to manage.

Core Data is almost always the right answer unless the data storage is trivial.

Update

Archiving, also known as serializing is one of the most expensive ways to write data to disk compared to other formats. The exact details are difficult to explain in an answer here but it boils down to an old design that does not perform nearly as well as the more modern persistence systems such as Core Data. Putting the two side by side you will see significant performance increases (due to internal threading, caching, database support on the backend, etc.) when using Core Data.

The fact that Core Data also handles your data model life cycle and structure is just gravy on top of that performance increase.

Marcus S. Zarra
Why archiving is expensive ?
hib
Thanks for your explanation .
hib