dispatch_queue_t queue=dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
NSString * from=@"";
NSString * to =@"";
NSFileManager * magr=[NSFileManager defaultManager];
NSArray * subpaths=[magr subpathsAtPath:from];//获得from路径下的所有文件
//同时便利作用
dispatch_apply(subpaths.count, queue, ^(size_t index) {
NSString * subpath=subpaths[index];
NSString * fromFullpath=[from stringByAppendingPathComponent:subpath];
NSString * toFullpath=[to stringByAppendingPathComponent:subpath];
[magr moveItemAtPath:fromFullpath toPath:toFullpath error:nil];
});
转载于:https://www.cnblogs.com/xiezefeng/p/5430898.html