1.nsstring *home = nshomedirectory(); Gets the directory path of the application,
There are three folders in the directory: Documents, Library, tmp
Documents: Primary storage: Use this path to place critical data, i.e. data that cannot be regenerated through the app
Library: Main storage: Cache files, can be generated in real-time.
TMP: The temporary file is stored and is automatically cleared when it is closed.
2. Write out the contents of the folder you want to clear.
Go to the folder according to the previous home path to view the folder you want to clear under library/caches/default/
nsstring *path = @ "library/caches/default/ Com.hackemist.SDWebImageCache.default ";
3. Stitching into a complete path
nsstring *newpath = [Home stringbyappendingpathcomponent:p ath];
4. Create a File Manager
Nsfilemanager *manager = [Nsfilemanager Defaultmanager];
5. The manager deletes the contents of this path
[Manager Removeitematpath:newpath];
6. Shows how much of the purge can get the cache size.
Use Sdimagecache frame: nsinteger size = [[Sdimagecache sharedimagecache] getsize];
This can be displayed on the label.
Manually clear the Cache