IOS How to copy file from folder to folder

+(BOOL)copyFileAtPath:(NSString *)atPath toPath:(NSString *)toPath {
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError    *error;
    if (![[NSFileManager defaultManager] copyItemAtURL:[NSURL fileURLWithPath:atPath] toURL:[NSURL fileURLWithPath:toPath] error:&error]) {
        NSLog(@"Error:%@",[error description]);
    } else {
        NSLog(@"atPath:%@  toPath:%@",atPath,toPath);
    }
       return [fileManager copyItemAtPath:atPath toPath:toPath error:nil];
}

Comments

Popular posts from this blog

Java : Variables Declaring

Install DNF in RHEL/CentOS 7

SQL Self JOIN