URLForUbiquityContainerIdentifier always returns zero

The simulator is in iOS8.1 and I am using Xcode 6.1.1.

I have tried solutions from several different sources:

And nothing works. My setup:

Rights and opportunities: enter image description here

enter image description here

The code:

dispatch_async(dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
    NSURL *myContainer = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];

    // unarchive journal object from iCloud
    if (myContainer != nil) {
        NSString *filePath = [NSString stringWithFormat:@"%@/%@", myContainer.path, ARCHIVE_FILE_NAME];
        self.journal = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath];

        // initialize journal from local storage if there no iCloud archive
        if (self.journal == nil)
            [self initJournalFromLocalStorage];
        else
            [self.journal validateUserDefines];

        self.journal.cloudURL = myContainer;

        dispatch_async (dispatch_get_main_queue (), ^(void) {
            // On the main thread, update UI and state as appropriate
        });
    }
});

My Apple ID has iCloud enabled for development and distribution; and I tried to create and upload a new training profile.

I also tried changing iCloud. $ (CFBundleIdentifier) ​​for $ (TeamIdentifierPrefix) $ (CFBundleIdentifier) ​​in rights.

No matter what I do, the URLForUbiquityContainerIdentifier always returns nil. Any help is appreciated!

+4
1

iCloud Drive ?

URLForUbiquityContainerIdentifier nil, iCloud Drive iOS 8.1 Simulator. , , . , iCloud Drive , . iCloud Drive, , .

+7

Source: https://habr.com/ru/post/1570332/


All Articles