Search code examples
iphoneobjective-cipadicloud

Use UIDocument or KVS when saving to iCloud?


I am working on an iOS app that I want to use iCloud for storing documents/presets. As you can see in the screenshots its quite a simple solution I have now. I Simply archive a list of presets (title, description, expression, and source). What would be the best solution for storing those presets/documents in iCloud so you can continue your work on iPhone/iPad/ (Maybe even OS X)?

Inherit from UIDocument, or use KVS with NSUbiquitousKeyValueStore?

iPad image of application

Thanks!


Solution

  • I would suggest NSUbiquitousKeyValueStore since you are not storing an actual document and more configuration setting, plus NSUbiquitousKeyValueStore has the auto synchronize with your app and iCloud that you don't have to worry about. Also this is basically free memory in iCloud that doesn't count against the users memory allocation on iCloud.

    If you are storing things like images, Documents would be a better fit.

    Good example here:

    https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/UserDefaults/StoringPreferenceDatainiCloud/StoringPreferenceDatainiCloud.html#//apple_ref/doc/uid/10000059i-CH7