Does the iPhone have a built-in caching mechanism (per application)?
Do I have to roll my own caching mechanism for data I'd like to persist, or is there something built-in that I can leverage? Any help would be great -开发者_Go百科 thanks in advance!
There's no built-in caching mechanism per-se, but SQLite, CoreData, etc. are available (or you could just use the built in NSKeyedArchiver/NSKeyedUnarchiver if you're only interested in storing a small amount of data (such as user preferences) in standard language objects and don't want to use a plist based settings approach.
That said, I'm not sure how/if these are wrapped in monotouch. (Search for the above NSKeyed.. methods and NSCoding and all should be revealed.)
What variety of persist are you interested in?
For long term storage there is CoreData and sqlite.
For inter invocation storage there are UserDefaults.
If it's just a little data--especially if it's user preferences and settings--there is NSUserDefaults. That's a pretty handy auto-persisting data interface. But it's not built for mass amounts of data.
精彩评论