[ACCEPTED]-Cocoa error 260-ftp
I've tried cleaning targets, resetting device, resetting 13 xcode.
Blind pounding on random targets is 12 never a good debugging technique. At best, you'll 11 fix the problem and not know how. At worst, you'll 10 break something else.
Instead, find out what the problem is. For 9 a “Cocoa error”, you'll want to look in 8 FoundationErrors.h and CoreDataErrors.h 7 (and AppKitErrors.h when not targeting Cocoa 6 Touch). The former file gives the name for 5 Cocoa error 260:
NSFileReadNoSuchFileError = 260, // Read error (no such file)
You're unable to get the 4 attributes of that file because it doesn't 3 exist (on your device).
You may want to edit 2 your question to include the code that creates 1 the path that you store into self.filePath
.
This solution resolves my problem i hope 1 it will helps you out.
I know Peter Hosey already has solved this 9 question, but I want to add something. If 8 you want to find your error quickly, you 7 can use a simple command in the terminal 6 to locate it's definition:
ief2s-iMac:Frameworks ief2$ cd /System/Library/Frameworks
ief2s-iMac:Frameworks ief2$ grep '260' $(find . -name "*Errors.h" )
- cd to your frameworks directory
- grep all the files ending with 'Errors.h' for the error code:
Change the '260' with 5 the error code you want. The above command 4 returns the following:
ief2s-iMac:Frameworks ief2$ grep '260' $(find . -name "*Errors.h" )
./CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacErrors.h: midiDupIDErr = -260, /*duplicate client ID*/
./CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacErrors.h: kECONNREFUSEDErr = -3260, /* Connection refused */
./Foundation.framework/Versions/C/Headers/FoundationErrors.h: NSFileReadNoSuchFileError = 260, // Read error (no such file)
ief2s-iMac:Frameworks ief2$
You could of course 3 better specify it by doing a grep on 'Error 2 = 260':
ief2s-iMac:Frameworks ief2$ grep 'Error = 260' `find . -name "*Errors.h"`
./Foundation.framework/Versions/C/Headers/FoundationErrors.h: NSFileReadNoSuchFileError = 260, // Read error (no such file)
ief2s-iMac:Frameworks ief2$
I hope this can help you with your 1 further development, ief2
+(DataManager*)getSharedInstance{
if (!sharedInstance) {
sharedInstance = [[super allocWithZone:NULL]init];
[sharedInstance copyDatabaseIntoDocumentsDirectory];
}
return sharedInstance;
}
-(void)copyDatabaseIntoDocumentsDirectory{
// Set the documents directory path to the documentsDirectory property.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
self.documentsDirectory = [paths objectAtIndex:0];
// Keep the database filename.
self.databaseFilename = DATABASE_FILENAME;
// Check if the database file exists in the documents directory.
destinationPath = [self.documentsDirectory stringByAppendingPathComponent:self.databaseFilename];
if (![[NSFileManager defaultManager] fileExistsAtPath:destinationPath]) {
// The database file does not exist in the documents directory, so copy it from the main bundle now.
NSString *sourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:self.databaseFilename];
NSError *error;
[[NSFileManager defaultManager] copyItemAtPath:sourcePath toPath:destinationPath error:&error];
// Check if any error occurred during copying and display it.
if (error != nil) {
NSLog(@"%@", [error localizedDescription]);
}
}
}
Note 3 : error 260 : meaning the file could not 2 be found at the path you specified (once 1 again create DB and then add your project).
In my case my 260 error was due to a folder 8 in the path Being camelCase.
In the simulator 7 it worked fine under OSX. However on an 6 iOS Device the case became very important.
I.E. I 5 was referencing a folder called ``@"/Data/somethings/"``` On 4 disk this was /data/somethings/
You have 3 to maintain a consistency of uppercase / lowercase 2 for iOS. So I had to make sure it was always 1 referred to as /data/somethings/
This error can be removed vey quickly. Please 4 do not drag and drop the database file into 3 the project. Go to "Add files" option and 2 then import the file. I tried this and error 1 was gone..
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.