【iOS知识学习】_iPhone清理缓存
来源:互联网 发布:js websocket链接不了 编辑:程序博客网 时间:2024/05/27 06:16
//清理缓存
-(void)cleanCache{
dispatch_async(
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0)
, ^{
NSString *cachPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES) objectAtIndex:0];
NSArray *files = [[NSFileManagerdefaultManager] subpathsAtPath:cachPath];
NSLog(@"files :%d",[filescount]);
for (NSString *pin files) {
NSError *error;
NSString *path = [cachPath stringByAppendingPathComponent:p];
if ([[NSFileManagerdefaultManager] fileExistsAtPath:path]) {
[[NSFileManagerdefaultManager] removeItemAtPath:patherror:&error];
}
}
[selfperformSelectorOnMainThread:@selector(Success)withObject:nilwaitUntilDone:YES];});
}
-(void)Success
{
[SVProgressHUDshowSuccessWithStatus:@"清理成功"];
}
- 【iOS知识学习】_iPhone清理缓存
- 【iOS知识学习】_iPhone学习四舍五入函数
- 【iOS知识学习】_iPhone学习访问联系人
- 【iOS知识学习】_iPhone开发必经
- 【iOS知识学习】_iPhone学习提交git@OSC
- 【iOS知识学习】_iPhone学习多个UITextField 键盘弹起
- 【iOS知识学习】_iPhone学习基于UIKeyboardTypeDecimalPad(数字键盘+小数点)
- 【iOS知识学习】_iPhone判定金额小数点相关代码
- 【iOS知识学习】_iPhone邮箱身份证电话号码验证
- 【iOS知识学习】_iPhone 之 Cer P12 Mobileprovition 文件
- 【iOS知识学习】_iPhone学习微信分享到好友/短信
- iOS学习总结之清理缓存
- ios清理缓存
- ios 清理缓存
- iOS 清理缓存
- ios 清理缓存
- iOS 清理缓存代码
- ios 清理缓存
- android 图片上传 php端
- STL标准库中的算法函数
- 我的决定
- GDB调试程序(一)
- nyoj 吝啬的国度(dfs无根树转有根树)
- 【iOS知识学习】_iPhone清理缓存
- 战国地图
- 第77题 Maximum Product Subarray
- 值类型与引用类型
- IOS绘画功能
- 计时器
- 递归实现字符串翻转
- php 中= ,==,===之间的区别
- 安装xampp后apache不能启动解决方法