Search code examples
iphoneiosios5ios6nsmutablearray

Importing, Displaying and Caching of large data


I'm trying to get data from some where and save it in a NSMutableArray of custom objects that contain that data and info.

Every time the user opens the app the same data is loaded from source and converted to my lovely array with custom objects. This takes a long time (~ 10-20s) and makes the app like a dumb. So what I tried to get the data and display it like in this link

What I tried:

  • save the array with custom objects to a file and load this file on next app start (if found) without a need to create the custom object from scratch again.
  • custom object encode & decode takes a long time at testing. Even if you save it in NSUserDefault.

Before any one start to answer this question plz. Have a look at the sample code and run it to make sure what I mean by retrieving the data and displaying it. in fast time after relaunch the sample and make what I wanna more clear :)

If anyone can make this sample more clear for me I will be thankful.


Solution

  • Thx all :)

    I found this simple tutorial that explain some parts of sample code "fetchedResultsController".

    and the different is in .pch file where there is ZAssert condition to fetch data when app start and when first time add.