iOS开发>学无止境 - 检测路径下文件夹是否存在
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(@"有");
}
本内容来自: 超越昨天(学无止境) - http://www.cnblogs.com/xvewuzhijing/