我试图访问应用程序包中某个特定文件夹的内容,以便将其复制到其他地方,但是每当我进入一个文件夹时,它似乎就给了我整个包的内容。知道我怎么能只在这个文件夹里得到内容吗?
我的代码
-(void) moveAssets {
NSString * resourcePath = [[NSBundle mainBundle] resourcePath];
NSLog(@"%@", resourcePath);
NSString *newPath = (@"%@/Test/",resourcePath);
NSError * error;
NSArray * directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:newPath error:&error];
for (NSString* currentString in directoryContents){
NSLog(@"%@",currentString);
}
}日志
日志继续给我所有的文件,而不仅仅是测试文件夹中的文件
发布于 2014-07-28 07:18:18
https://stackoverflow.com/questions/24990195
复制相似问题