5

Hi I have developed an iPhone app in which I am storing the NSMutableArray into NSUserDefaults. But now I want to sync the same NSMutableArray/NSUserDefaults to iCloud and also I want to retrieve from the iCloud. Does anybody know how to do this. Thanks in advance.

Shakti
  • 1,889
  • 4
  • 18
  • 29
  • 1
    There is a very good discussion of this topic here: http://stackoverflow.com/questions/7810157/can-i-use-icloud-to-sync-the-nsuserdefaults-plist-file – Matt Jan 16 '12 at 18:48

2 Answers2

11

I needed something similar for my app. I wrote a library that saves to both iCloud and NSUserDefaults and put it on GitHub. It's called SDCloudUserDefaults.

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
9

Use NSUbiquitousKeyValueStore. See Apple's document, Storing Preferences in iCloud

Rose Perrone
  • 61,572
  • 58
  • 208
  • 243