在我的程序之后显示 Documents 目录的内容并显示在 tableView 中。但 Documents 目录包含一些目录、一些音频、一些视频和一些图像等。
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsDir = [dirPaths objectAtIndex:0];
fileType = @"" ;
NSString *subDirectoryPath = [docsDir stringByAppendingPathComponent:fileType];
NSLog(@"path : %@",subDirectoryPath);
files = [[NSMutableArray alloc] initWithArray:[[NSFileManager defaultManager] contentsOfDirectoryAtPath:subDirectoryPath error:nil]];
NSLog(@"files ::::: %@ ",[files description]);
所以,我想检查文件是否是目录,然后它的目录图像可以显示在单元格的 imageView 中。音频、视频和图像也是如此。
我在 NSFileManager classReference 中进行了搜索,但得到了解决方案。
这个怎么做 ?