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.");

    }

 

相关文章:

  • 2021-12-21
  • 2022-12-23
  • 2022-03-02
  • 2021-11-30
  • 2021-07-09
  • 2021-06-02
  • 2022-01-12
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
相关资源
相似解决方案