I keep getting this error. I'm uploading via ftp to a server. It works fine and uploads completely while running in the simulator, but when I provision it on my iPhone, it says: Error Occurred. Upload failed: The operation couldn’t be completed. (Cocoa error 260.)
Any suggestions? I've been debugging and researching for hours on end and can't figure this out. I've tried cleaning targets, resetting device, resetting xcode.
One thing I narrowed down was:
NSError *attributesError = nil; NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.filePath error:&attributesError]; if (attributesError) { [self failWithError:attributesError]; return; }
In the device attributesError is true, in the simulator it is false
This error means that the directory cannot be created because of a permission error.
The core attributes of an NSError object are an error domain (represented by a string), a domain-specific error code and a user info dictionary containing application specific information.
Information about an error condition including a domain, a domain-specific error code, and application-specific information.
I've tried cleaning targets, resetting device, resetting xcode.
Blind pounding on random targets is never a good debugging technique. At best, you'll fix the problem and not know how. At worst, you'll break something else.
Instead, find out what the problem is. For a “Cocoa error”, you'll want to look in FoundationErrors.h and CoreDataErrors.h (and AppKitErrors.h when not targeting Cocoa Touch). The former file gives the name for Cocoa error 260:
NSFileReadNoSuchFileError = 260, // Read error (no such file)
You're unable to get the attributes of that file because it doesn't exist (on your device).
You may want to edit your question to include the code that creates the path that you store into self.filePath
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With