Equivalent to ubiquityIdentityToken under OSX 10.7

I am trying to add iCloud support to my iOS-5.1 application, according to the Apple iCloud Design Guide in the "Prepare Your Application for Use iCloud" section. It says:

At the beginning of the application launch process, in the application: doneFinishLaunchingWithOptions: method (iOS) or applicationDidFinishLaunching: method (OS X), check the availability of iCloud by calling the NSFileManager ubiquityIdentityToken method, as follows:

id currentiCloudToken = [[NSFileManager defaultManager] ubiquityIdentityToken];

The problem is that this method ( ubiquityIdentityToken) is available on OS X version 10.8 and later, and I only have 10.7.4 installed.

Is there any solution or other solution if I do development under 10.7? And why is the availability of this method related to the OSX version and not the iOS version?

+1
source share
2 answers

Andrea answers your first question.

With regard to your second question about why this is the case: according to the documentation iOS class NSFileManager , ubiquityIdentityTokenis only available for iOS 6.0+. You might have read the OS X entry for NSFileManagerinstead of iOS, so you saw OS X requirements.

+5
source

From the OS X release notes:

On Mac OS 10.7, the only way to check if a user is logged into iCloud with data and documents enabled is [NSFileManager URLForUbiquityContainerIdentifier:] and check for a non-zero URL. However, this method can sometimes block a significant amount, which makes it unsuitable for calling from the main thread.

+1

All Articles