NSBundle *bundle=[NSBundle mainBundle];NSString *mp4path=[bundle pathForResource:@"thecopyfile" ofType:@"mp4"];NSString*filepath=[NSHomeDirectory() stringByAppendingPathComponent:@"Caches/A"];NSFileManager *fileManager=[NSFileManager defaultManager]; [fileManager copyItemAtPath:mp4path toPath:filepath error:&error];
然后我再去获取A文件夹中的所有文件
for (NSString *filename in [fileManager enumeratorAtPath:filepath]) {
NSLog(@"%@",filename);
}但是却找不到开始复制过去的那个thecopyfile.mp4文件
然后我再去获取A文件夹中的所有文件
for (NSString *filename in [fileManager enumeratorAtPath:filepath]) {
NSLog(@"%@",filename);
}但是却找不到开始复制过去的那个thecopyfile.mp4文件
其次取a文件夹下面的文件不用enumeratorAtPath,而是contentsOfDirectoryAtPath,这个path才是路径,不能写成了文件的地址。
subpathsOfDirectoryAtPath:
contentsOfDirectoryAtPath:
enumeratorAtPath:
他们有什么区别呢