I am using NSUbiquitousKeyValueStore
to sync some preference data to iCloud. I found that if the user disable \"Document & Data\" item of iCloud in \"Settin
Basically, NSUbiquitousKeyValueStore
is always available, even if the user does not have an iCloud account (in this case, NSUbiquitousKeyValueStore
is just a simple local storage). So in general, you don't need to ask yourself or the user if there is a configured iCloud account.
If you really want to know for sure, in iOS 5, the only solution is the one you're mentioning.
I don't know if the docs have been updated, but Apple is now saying:
To determine if iCloud is available, especially at launch time, check the value of the ubiquityIdentityToken property instead
See NSFileManager for both ubiquityIdentityToken
and URLForUbiquityContainerIdentifier
.
Note also that Apple is saying that URLForUbiquityContainerIdentifier
can be relatively slow, and that checking ubiquityIdentityToken
is relatively fast.
This is for iOS6 and higher.