Note that there are some explanatory texts on larger screens.

plurals
  1. PO"The operation couldn’t be completed. Operation not permitted" error when simply sending image to icloud
    text
    copied!<p>Im simply trying to upload this image to iCloud. It keeps giving me the error "The operation couldn’t be completed. Operation not permitted". I took this code right out of the Document Based App Programming Guide and I believe I've set all my certificates, identifiers, profiles, and entitlements correctly. Any help would be much appreciated. This is insanely frustrating. </p> <pre><code>#import "docx.h" @implementation docx -(IBAction)test:(id)sender{ NSURL *src = [NSURL URLWithString:@"/Users/rjm226/Desktop/jh.jpg"]; NSLog(@"%@", src); NSURL *dest = NULL; NSURL *ubiquityContainerURL = [[[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil] URLByAppendingPathComponent:@"Documents"]; if (ubiquityContainerURL == nil) { NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@"iCloud does not appear to be configured.", @""), NSLocalizedFailureReasonErrorKey, nil]; NSError *error = [NSError errorWithDomain:@"Application" code:404 userInfo:dict]; [self presentError:error modalForWindow:[self windowForSheet] delegate:nil didPresentSelector:NULL contextInfo:NULL]; return; } dest = [ubiquityContainerURL URLByAppendingPathComponent: [src lastPathComponent]]; //Move file to iCloud dispatch_queue_t globalQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(globalQueue, ^(void) { NSFileManager *fileManager = [[NSFileManager alloc] init]; NSError *error = nil; // Move the file. BOOL success = [fileManager setUbiquitous:YES itemAtURL:src destinationURL:dest error:&amp;error]; dispatch_async(dispatch_get_main_queue(), ^(void) { if (! success) { [self presentError:error modalForWindow:[self windowForSheet] delegate:nil didPresentSelector:NULL contextInfo:NULL]; } }); }); } @end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload