清空iOS应用程序缓存
来源:互联网 发布:防广告弹出软件 编辑:程序博客网 时间:2024/05/22 04:46
清空iOS应用程序缓存
清理缓存
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) , ^{ NSString *cachPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask, YES) objectAtIndex:0]; NSArray *files = [[NSFileManager defaultManager] subpathsAtPath:cachPath]; NSLog(@"files :%ld",[files count]); for (NSString *p in files) { NSError *error; NSString *path = [cachPath stringByAppendingPathComponent:p]; if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { [[NSFileManager defaultManager] removeItemAtPath:path error:&error]; } } [self performSelectorOnMainThread:@selector(clearCacheSuccess) withObject:nil waitUntilDone:YES]; } );
清理成功后的回调
-(void)clearCacheSuccess{ NSLog(@"清理成功");}
1 0
- 清空iOS应用程序缓存
- iOS SDWebImage 清空缓存 新方法
- iOS【彻底清空APP缓存】
- 清空页面缓存
- 清空页面缓存
- jsp清空缓存
- 清空oracle缓存
- 清空数据库缓存
- 清空IIS缓存
- 清空所有缓存
- 清空tomcat缓存
- jsp 清空缓存
- sqlserver清空缓存
- 清空页面缓存
- 清空浏览器缓存
- 清空缓存
- 清空tomcat缓存
- 清空DNS缓存
- 关于WLAN抓取的是以太网帧的问题
- linux驱动学习笔记4
- 四种途径将HTML5 web应用变成android应用
- Angularjs路由
- 孔浩老师SpringMVC视频总结
- 清空iOS应用程序缓存
- 我的365之1
- 欢迎使用CSDN-markdown编辑器
- Android省电开发 浅析
- github使用总结
- 实现AspxGridView主从表选择行状态保持
- cocos2d-x大神们的博客集合
- javascript学习之变量和数据类型
- Codeforce 1A. Theatre Square