我的程序显示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]);
Run Code Online (Sandbox Code Playgroud)
所以,我想检查文件是否是目录,然后它的目录图像可以显示在单元格的imageView中.音频,视频和图像也是如此.
我在NSFileManager classReference中搜索过,但是dint得到了一个解决方案.
这该怎么做 ?