Shakti
Shakti

Reputation: 1959

How to sync NSUserDefaults data with iCloud

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.

Upvotes: 5

Views: 5584

Answers (2)

Rose Perrone
Rose Perrone

Reputation: 63566

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

Upvotes: 10

Stephen Darlington
Stephen Darlington

Reputation: 52565

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.

Upvotes: 11

Related Questions