1. Find the Sdimagecache class
2. Add the following method:
[OBJC] View plaincopy
-(float) checktmpsize
{
-
float totalsize = ;  
-
nsdirectoryenumerator defaultmanager enumeratoratpath :d iskcachepath];
for (nsstring *filename in FileEnumerator)
{
NSString *filepath = [Diskcachepath stringbyappendingpathcomponent: FileName];
nsdictionary*attrs = [[NsfilemanagerDefaultmanager]Attributesofitematpath: FilePathError: Nil];
-
unsigned long long length = [attrs filesize
TotalSize + = length/1024. 0 / 1024. 0;
}
//NSLog (@ "tmp size is%.2f", totalsize);
return totalsize;
}
This method has been added to the new Sdimagecache class
[OBJC] View plaincopy
[[Sdimagecache sharedimagecache] getsize];
3. Use in Settings like this
[OBJC] View plaincopy
#pragma clean up cached pictures
-(void) cleartmppics
{
[[Sdimagecache sharedimagecache] cleardisk];
//[[Sdimagecache Sharedimagecache] clearmemory];//dispensable
DLog (@ "Clear disk");
-
-
float tmpsize = [[sdimagecache sharedimagecache checktmpsize
NSString*clearcachename = tmpsize >=1 ? [NSStringstringWithFormat:@ "Clean cache (%.2FM)", tmpsize]: [NSStringstringWithFormat:@ "Clean cache (%.2FK)",tmpsize *1024x768];
[Configdataarray replaceobjectatindex:2 withobject: Clearcachename];
[Configtableview reloaddata];
}
Sdimagecache clearing the cache