简体   繁体   English

如何在iPhone应用程序中以编程方式将目录的内容复制到另一个目录

[英]How to copy contents of a directory into a another directory programmatically in an iPhone app

I have 2 directories which are created programmatically, say DIR1 & DIR2 and DIR1 have some XML files now I need to copy the contents of DIR! 我有2个通过编程方式创建的目录,例如DIR1&DIR2和DIR1现在有一些XML文件,我需要复制DIR的内容! into DIR2 without giving the Contents name 进入DIR2而不给出目录名称

is this possible? 这可能吗?

You can use - (BOOL)copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error method to copy. 您可以使用- (BOOL)copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error方法进行复制。 Refer this link. 请参考链接。 It will help you. 它会帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM