Clear the picture cache

Source: Internet
Author: User

? -(void) setupGroup1

{

//1. Create a group

lkcommongroup *group = [lkcommongroup Group];

[self. groups addobject: group];

//2. set up all row data for a group

lkcommonarrowitem *clearcache = [lkcommonarrowitem itemwithtitle< /c5>:@ " clear Image cache "];

// Set the size of the cache

NSString *caches = [Nssearchpathfordirectoriesindomains (nscachesdirectory, Nsuserdomainmask, YES) lastObject];

[Caches stringbyappendingpathcomponent:@ "Com.hackemist.SDWebImageCache.default"];

& nbsp    nsstring  *imagecachepath = [ sdimagecache &NBSP; sharedimagecache diskcachepath

long long fileSize = [Imagecachepath fileSize];

& nbsp   ClearCache. subtitle  = [ NSString &NBSP; stringWithFormat : @ "(%.1FM)" 1000.0 &NBSP;*&NBSP; 1000.0 )];

__weak typeof(clearcache) Weakclearcache = ClearCache;

__weak typeof (self) weakvc = self;

ClearCache. Operation  = ^{

[mbprogresshud showmessage:@ " clearing cache ... " ];

// Clear Cache

nsfilemanager *mgr = [nsfilemanager defaultmanager];

[Mgr removeitematpath: Imagecachepath error:nil];

// set subtitle

Weakclearcache. subtitle  =  Nil ;

// Refresh table

[WEAKVC. TableView reloaddata];

[mbprogresshud hidehud];

};

Group. Items  =  @[clearcache] ;

//Lklog (@ "%lld", [@ "/users/apple/desktop/ music " fileSize]);

}


Clear the picture cache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.