1,判断某一路径是否包含后一文件夹
[fileManager fileExistsAtPath:filePathName isDirectory:(&isDir)];
if (!isDir) {
UIImage *temp = [UIImage imageWithContentsOfFile:filePathName];
[imgArray addObject:temp];
}
isDir = NO;
2.判断某一文件是否是png文件
if ([filePathName hasSuffix:@"png"]) {
UIImage *temp = [UIImage imageWithContentsOfFile:filePathName];
[imgArray addObject:temp];
}
3.如何用nslog输出BOOL
NSLog(@"isSave:%@",isSave ? @"YES":@"NO");
4.如何将文件保存到某一文件夹中
BOOL isSave = [fileManager createFileAtPath:newPathCopy contents:imageData attributes:nil];
该路径newPathCopy要指定到某一文件的后缀,