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];
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
{
UIWindow * window = [[[UIApplication sharedapplication]delegate] window];
showhudwithtext:@ "" Type:enabled: third-party library
[Window showhudwithtext:@ "data cache cleared" Type:showphotoyes Enabled:yes];
}
How the APP clears the cache