1

I have iCloud support in my application. and I save database in iCloud successfully. But when I try to download this database file by using bellow code

NSFileManager *fm = [NSFileManager defaultManager];

    NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];

    if (ubiq == nil) {
        return;
    }

    NSError *theError = nil;

    NSURL *url = [[ubiq URLByAppendingPathComponent:@"Documents" isDirectory:true] URLByAppendingPathComponent:fileName];

    bool started = [fm startDownloadingUbiquitousItemAtURL:url error:&theError];

    NSLog(@"started download for %@ %d", fileName, started);

    if (theError != nil) {
        NSLog(@"iCloud error: %@", [theError localizedDescription]);
    }
    else
    {

    }

Downloading start successfully but I don't know where it will be download OR what will be the destination path. How can I save this file to local directory of app. Please help

Altaf Rehman
  • 119
  • 7

0 Answers0