How do we know if iCloud actually contains a key/value pair?
How do we know if iCloud actually contains a key/value pair?
- Subject: How do we know if iCloud actually contains a key/value pair?
- From: G S <email@hidden>
- Date: Mon, 05 Mar 2012 22:48:14 -0800
When our iPhone app is launched for the first time, it checks the user's
iCloud account to see if he has installed our app on another device. If
so, he'll have a unique ID that we've stored in his iCloud account, which
is a database key that we use to manage his online content. We grab it and
store it in local user defaults.
If the user doesn't have an ID in iCloud, we create one, store it in local
user defaults and save it to iCloud.
During appDidFinishLaunching, I instantiate the ubiquitous store and call
[synchronize].
After figuring out that we always have to listen for the
NSUbiquitousKeyValueStoreDidChangeExternallyNotification (even though the
external repository actually didn't change), I'm left with this question:
How do I know if this call simply failed, or if the value is absent from
the remote server?
Will this notification be issued even if the key/value pair doesn't exist?
If not, how do I ever know that key/value pair is absent from iCloud and
that I won't be overwriting it if I store a new one there?
Thanks for any insight.
Gavin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden