Correct way caching data on iPhone/iPad
What is the correct way to cache file and/or string data on ios? Is CoreData useful for this, or is there a better wat of doing this?
What is the best method to cache for performance and what for caching for persistence for any amount of data?
I can't seem to find any nice Appl开发者_JAVA百科e docs about this subject.
I prefer NSCache
docs here:
http://developer.apple.com/library/ios/#documentation/cocoa/reference/NSCache_Class/Reference/Reference.html
There are many different solutions to this problem and there is no "right" way to do it. A few popular options are:
Core Data - Apple's framework for persistence. Very performant, but more difficult. SQLite - Fast and flexible, but bare bones. Plists - Basically writing a file to disk, you have to read and write manually. NSUserDefaults - The lightest weight "key-value" option. I would encourage you to read up on all four and see which one works best for you.
精彩评论