NSLog (@ "Customer service phone");
Uiwebview*callwebview =[[uiwebview alloc] init];
Nsurl *telurl =[nsurl urlwithstring:@ "tel:400-041-5656"];//looks like tel://or Tel: All right
[Callwebview loadrequest:[nsurlrequest Requestwithurl:telurl];
Remember to add to the view
[Self.view Addsubview:callwebview];
Get the size of the cache file
Because the cache file exists in the sandbox, we can use the Nsfilemanager API to calculate the size of the cache file.
Calculate a single File size
Calculate Directory Size
+ (float) Foldersizeatpath: (nsstring*) path{Nsfilemanager*filemanager=[nsfilemanager Defaultmanager];float foldersize; if ([FileManager Fileexistsatpath:path]) {Nsarray*childerfiles=[filemanager Subpathsatpath:path];for (NSString*filename in Childerfiles) { nsstring *absolutepath=[path Stringbyappendingpathcomponent:filename]; foldersize +=[fileservice Filesizeatpath:absolutepath]; } // Implementation of Sdwebimage framework self-calculation cache foldersize< Span class= "RegExp" >+=[[sdimagecache Sharedimagecache] Getsize]/1024.0/ 1024.0; return foldersize; } return 0;}
Clean up cache files
Also using the Nsfilemanager API for file operations, the Sdwebimage framework itself implements the cleanup cache operation, which we can call directly.
+ (void) ClearCache: (nsstring*) path{Nsfilemanager*filemanager=[nsfilemanager Defaultmanager];if ([FileManager Fileexistsatpath:path]) { nsarray *childerfiles=[filemanager Subpathsatpath:path]; for (nsstring * FileName in Childerfiles) { //if necessary, join the conditions, filter out files that you do not want to delete nsstring *absolutepath=[path stringbyappendingpathcomponent: FileName]; [filemanager removeItemAtPath: Absolutepath Error:nil]; } } [[Sdimagecache Sharedimagecache] cleandisk];}
Making calls and clearing the cache