标签:
NSFileManager*fileManager = [[NSFileManager alloc] init];
NSString *pathDocuments = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
//缩略图路径
createPath = [NSString stringWithFormat:@"%@/ThumbnailImage", pathDocuments];
//原图路径
createDir = [NSString stringWithFormat:@"%@/OriginalImage", pathDocuments];
// 判断文件夹是否存在,如果不存在,则创建
if (![[NSFileManager defaultManager] fileExistsAtPath:createPath]) {
[fileManager createDirectoryAtPath:createPath withIntermediateDirectories:YES attributes:nil error:nil];
[fileManager createDirectoryAtPath:createDir withIntermediateDirectories:YES attributes:nil error:nil];
} else {
NSLog(@"FileDir is exists.");
}
标签:
原文地址:http://www.cnblogs.com/liuting-1204/p/5606515.html