首页 > 移动平台 > 详细

iOS开发 - 检测路径下文件夹是否存在

时间:2015-11-27 20:01:44      阅读:310      评论:0      收藏:0      [点我收藏+]

 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(@"有");

    }

 

iOS开发 - 检测路径下文件夹是否存在

原文:http://www.cnblogs.com/xvewuzhijing/p/5001448.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!