美文网首页
iOS清除缓存

iOS清除缓存

作者: pokeey | 来源:发表于2018-07-16 17:12 被阅读0次
- (void)clearCacheClick
{
    [SVProgressHUD showWithStatus:@"clearing···"];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
    
    [[SDImageCache sharedImageCache] clearDiskOnCompletion:^{
        dispatch_async(dispatch_get_global_queue(0, 0), ^{
           
            [NSThread sleepForTimeInterval:2.0];
            
            NSFileManager *mgr = [NSFileManager defaultManager];
            [mgr removeItemAtPath:kFILECACHE_PATH error:nil];
            [mgr createDirectoryAtPath:kFILECACHE_PATH withIntermediateDirectories:YES attributes:nil error:nil];
            
            dispatch_async(dispatch_get_main_queue(), ^{
               
                [SVProgressHUD dismiss];
                
                // 设置文字
                self.detailTextLabel.text = nil;
                
            });
            
        });
    }];
}

相关文章

  • WkWebView 清除缓存 ios8

    WkWebView 清除缓存 ios8iOS8系统NSString *libraryDir = NSSearchP...

  • 清楚WKWebView缓存

    WKWebView清除缓存WKWebView,在iOS9以后提供了缓存管理类WKWebsiteDataStore,...

  • iOS清除UIWebView缓存

    使用iOS的webview会自动进行缓存,在开发的时候要记得清除Cookie和缓存。

  • iOS 清除缓存

    iOS的缓存一般分为两部分,一部分是下载数据产生的缓存,这部分有系统做了缓存,在沙盒里面,还有一部分是图片的缓存,...

  • iOS清除缓存

  • 清除缓存ios

  • iOS清除缓存

    #pragma mark - 第一步,计算缓存文件的大小 //首先获取缓存文件的路径 -(NSString *)g...

  • ios清除缓存

  • iOS 清除缓存

    iOS 清除缓存 我们在使用任何一款APP的时候,无论是苹果的 还是安卓的 都会产生一些缓存 ,我们在使用APP的...

  • iOS 清除缓存

    我们在使用任何一款APP的时候,无论是苹果的 还是安卓的 都会产生一些缓存 ,我们在使用APP的时候 就要定期去清...

网友评论

      本文标题:iOS清除缓存

      本文链接:https://www.haomeiwen.com/subject/lhibpftx.html