1

I have to download some info from the Internet, like what's the phone number of a person. I want to save the info in disk in order to load it when my application starts. So I want to know whether Core data is the best choice? I mean is it fast enough? I want to load the info into NSCache object, is it a good class I can use?

Andrea Sindico
  • 7,358
  • 6
  • 47
  • 84
NOrder
  • 2,483
  • 5
  • 26
  • 44

2 Answers2

1

It is a Plist type caching; key->value, only strings. Easy coding. For a few data I would recommend this. described here

The other one with NSArchiver->NSData: binary storage, any type of data, but you have to deserialize and deserialize. More coding, no limits ( well, you are doing the transformation) . I do proffer this one, because during the development, maybe I will need later some other data than text. Usually need to cache images. presented here actually the good answer is with downvote!

Community
  • 1
  • 1
1

If you are storing anything that will be used between launches of the application then using Core Data is the way to go unless you have really, really basic requirements. NSCache is better as a temporary cache that is used by the application as it is running and for data that can be recalculated if it does not already exist.

Abizern
  • 146,289
  • 39
  • 203
  • 257