2012-06-29 7 views

Répondre

3
BOOL success; 
NSError *error; 

NSFileManager *fileManager = [NSFileManager defaultManager]; 

NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; 
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"Data.txt"]; 

success = [fileManager fileExistsAtPath:filePath]; 
if (!success) {  
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"txt"]; 
    success = [fileManager copyItemAtPath:path toPath:filePath error:&error]; 

} 

En application a fait le lancement de finition avec des options

Questions connexes