美文网首页
创建文件夹

创建文件夹

作者: 来敲代码 | 来源:发表于2019-07-11 11:16 被阅读0次
#pragma mark 创建文件夹
- (void)createDocumentsPath
{
    NSString *createFilePath = [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/试一试"]];
    
    if ([[NSFileManager defaultManager] fileExistsAtPath:createFilePath]) {
        //文件夹已存在
        NSLog(@"试一试文件夹 已经存在!!!!!");
        return;
    } else {
        //创建文件夹
        bool  Exists = [[NSFileManager defaultManager] createDirectoryAtPath:createFilePath withIntermediateDirectories:YES attributes:nil error:nil];
        if (Exists) {
            NSLog(@"创建试一试文件夹 成功!!!!!");
        }else{
            NSLog(@"创建试一试文件夹 失败!!!!!");
        }
    }
}

相关文章

网友评论

      本文标题:创建文件夹

      本文链接:https://www.haomeiwen.com/subject/uqerkctx.html