zoukankan      html  css  js  c++  java
  • iOS SDWebImage清理缓存数据

    - (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;
    }

  • 相关阅读:
    C++中类模板的概念和意义
    欢迎访问新博客aiyoupass.com
    P2327
    P2885
    P1968
    Link-Cut-Tree
    树的重心
    点分治笔记
    SPOJ 375
    树链剖分
  • 原文地址:https://www.cnblogs.com/tmf-4838/p/5393405.html
Copyright © 2011-2022 走看看