- (void)showInfo { NSDirectoryEnumerator *fileEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:diskCachePath]; int i = 0; float total = 0.0f; NSNumberFormatter *numberFormatter =[[NSNumberFormatter alloc] init]; [numberFormatter setPositiveFormat: @"#,##0.## bytes"]; for (NSString *fileName in fileEnumerator){ NSLog(@"filename %d : %@", i, fileName); NSString *filePath = [diskCachePath stringByAppendingPathComponent:fileName]; NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil]; if (attrs) { //获取文件的字节大小 NSNumber *fileSize = (NSNumber*)[attrs objectForKey: NSFileSize]; total = [fileSize floatValue] + total; //格式化文件大小 NSString *A = [numberFormatter stringFromNumber: fileSize]; NSLog(@"filesize %d : %@", i, A); } ++i; } NSLog(@"%f bytes (%f M) in cache", total, total / 1024.0 / 1024.0); [numberFormatter release]; }
SDImageCache *cache = [SDImageCachesharedImageCache];
NSLog(@"cache 位置: %@", [cache getDiskCachePath]);
[cache clearDisk];
[cache clearMemory];
相关推荐
chrome缓存清除扩展程序,通过js清除chrome缓存的api演示
清除IE缓存.批处理,清除IE缓存.批处理,清除IE缓存.批处理
mave里面用命令行清楚缓存文件.
清除Jquery缓存语句
三星T231如何清除浏览器缓存-T231清除浏览器缓存教程.docx
清除maven缓存 绝对可用.里面有(windows/mac/linux)版本
一键清除IE缓存一键清除IE缓存一键清除IE缓存一键清除IE缓存一键清除IE缓存
可清除打印缓存,用于打印机取消打印的文档。
清除framework缓存快捷方式并启动工程
完美清除IE缓存和Cookies,以及浏览记录,密码等。 @kingsee。
文档讲述了消除301缓存的方法,并举例说明
windows清除图标缓存,管理员权限运行。文本工具打开查看源码。
清除连接缓存.bat
清除NC缓存工具 清NC缓存,适用nc各版本
有关于jsp页面缓存的介绍及缓存的清除,缓存的解决办法有两种,一种是服务端方法,另一种是客户端方法
清除缓存.bat
微信清除缓存微信清除缓存
发布了程序后,需要清楚缓存。本文详细介绍了如何清除tomcat缓存,
JSP清除缓存.txt!JSP清除缓存.txt!JSP清除缓存.txt!JSP清除缓存.txt!JSP清除缓存.txt!
清除图标缓存.bat