.找到 SDWebImage找到SDImageCache类

添加如下方法

复制代码
- (float)checkTmpSize
{
    float totalSize = 0;
    NSDirectoryEnumerator *fileEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:_diskCachePath];
    for (NSString *fileName in fileEnumerator)
    {
        NSString *filePath = [_diskCachePath stringByAppendingPathComponent:fileName];
        
        NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
        
        unsigned long long length = [attrs fileSize];
        
        totalSize += length / 1024.0 / 1024.0;
    }
    //    NSLog(@"tmp size is %.2f",totalSize);
    
    return totalSize;
}
复制代码
posted on 2016-04-14 22:29  pruple_Boy  阅读(206)  评论(0编辑  收藏  举报