NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *homePath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libraryPath = [homePath objectAtIndex:0];
NSString *tempPath = [libraryPath stringByAppendingPathComponent:@"Application Support"];
//判断temp文件夹是否存在
BOOL tempFileExists = [fileManager fileExistsAtPath:tempPath];
if (!tempFileExists) {//如果不存在说创建,因为下载时,不会自动创建文件夹
NSLog(@"没有");
} else {
NSLog(@"有");
}
时间: 2024-12-27 07:20:16