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
+(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 : error 260 : meaning the file could not be found at the path you specified (once again create DB and then add your project).