BOOL success;
NSFileManager *fileManager = [[NSFileManager defaultManager]autorelease];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:@"DB"];
success = [fileManager fileExistsAtPath:documentDBFolderPath];
if (success){
return;
}else{
NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath]
stringByAppendingPathComponent:@"DB"];
[fileManager createDirectoryAtPath: documentDBFolderPath attributes:nil];
[fileManager copyItemAtPath:resourceDBFolderPath toPath:documentDBFolderPath
error:&error];
}
}
In questo modo.Copia cartella da iPhone Directory risorse nella directory documenti
Risorse/DB/words.csv => DB cartella copia => Documento/DB/words.csv
voglio copiare DB sottodirectory a cartella Risorse. Pensavo che la fonte sia buona. Ma questa fonte rende la cartella e non copia i file nella cartella DB nella cartella Risorse.
Desidero davvero copiare i file nella cartella DB nella cartella Risorse. mi aiuti per favore.
OH !! davvero davvero davvero grazie !! Grazie!! – Beomseok