首先要获取cache文件夹路径
#define cachePath [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]
//
// LLFileTool.h
// BuDeJie
//
// Created by llkj on 2017/10/13.
// Copyright © 2017年 LayneCheung. All rights reserved.
// 处理文件缓存
#import <Foundation/Foundation.h>
@interface LLFileTool : NSObject
/**
删除文件夹所有文件
@param directoryPath 文件夹路径
*/
+ (void)removeDirectoryPath:(NSString *)directoryPath;
/**
获取文件夹尺寸
@param directoryPath 文件夹路径
@param completion 文件夹尺寸
*/
+ (void)getFileSize:(NSString *)directoryPath completion:(void(^)(NSInteger totalSize))completion;
@end
//
// LLFileTool.m
// BuDeJie