ios清除缓存3
来源:互联网 发布:游戏帧数软件 编辑:程序博客网 时间:2024/05/19 22:51
一段清理缓存的代码如下:
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 :%d",[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:nilwaitUntilDone:YES];});
-(void)clearCacheSuccess
{
NSLog(@"清理成功");
}
- ios清除缓存3
- ios webview清除缓存。
- ios webview清除缓存
- iOS开发清除缓存
- ios webview清除缓存
- ios webview清除缓存
- ios webview清除缓存
- IOS清除缓存
- iOS清除缓存
- 清除ios的缓存
- iOS 清除缓存
- iOS 清除缓存
- iOS 清除缓存
- iOS清除缓存
- iOS清除缓存
- iOS 清除缓存
- iOS 清除缓存
- iOS ---清除缓存
- php错误级别
- 尖峰日96万订单,59校园狂欢节技术架构剖析
- Fragment学习关注网址
- Third-实现基本交互
- 漫谈代理模式
- ios清除缓存3
- Spark RpcEnv
- android实现引导图全屏显示
- VMWare虚拟机提示:锁定文件失败,打不开磁盘的解决办法
- android连接Mysql数据库之JDBC方式
- web前端框架选型
- HashMap和Hashtable的区别
- 2007版的office软件下载及简介
- Fourth-更丰富的用户界面