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 can be removed vey quickly. Please do not drag and drop the database file into the project. Go to "Add files" option and then import the file. I tried this and error was gone..
}
-(void)copyDatabaseIntoDocumentsDirectory{
}
Note : error 260 : meaning the file could not be found at the path you specified (once again create DB and then add your project).
This solution resolves my problem i hope it will helps you out.
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:
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
.I know Peter Hosey already has solved this question, but I want to add something. If you want to find your error quickly, you can use a simple command in the terminal to locate it's definition:
Change the '260' with the error code you want. The above command returns the following:
You could of course better specify it by doing a grep on 'Error = 260':
I hope this can help you with your further development, ief2
In my case my 260 error was due to a folder in the path Being camelCase.
In the simulator it worked fine under OSX. However on an iOS Device the case became very important.
I.E. I was referencing a folder called ``@"/Data/somethings/"``` On disk this was /data/somethings/
You have to maintain a consistency of uppercase / lowercase for iOS. So I had to make sure it was always referred to as /data/somethings/