??????????????????????????????????????洦????????????????????????к????е???????????SDWebImage??
????????????????????????洢???????????????????????????????????????app????書???
???????????????湦??????????????????????С??????????????????????
?????????????????С
??????????????????????У???????????NSFileManager API??????????????С?????
???????????????С
????+(float)fileSizeAtPath:(NSString*)path{
????NSFileManager*fileManager=[NSFileManager defaultManager];
????if([fileManager fileExistsAtPath:path]){
????long long size=[fileManager attributesOfItemAtPath:path error:nil].fileSize;
????return size/1024.0/1024.0;
????}
????return 0;
????}
????????????С
????+(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];
????}
????//SDWebImage????????????????
????folderSize+=[[SDImageCache sharedImageCache]getSize]/1024.0/1024.0;
????return folderSize;
????}
????return 0;
????}
??????????????
??????????????NSFileManager API?????????????SDWebImage???????????????????????????????????á?
????+(void)clearCache:(NSString*)path{
????NSFileManager*fileManager=[NSFileManager defaultManager];
????if([fileManager fileExistsAtPath:path]){
????NSArray*childerFiles=[fileManager subpathsAtPath:path];
????for(NSString*fileName in childerFiles){
????//???????????????????????????????????
????NSString*absolutePath=[path stringByAppendingPathComponent:fileName];
????[fileManager removeItemAtPath:absolutePath error:nil];
????}
????}
????[[SDImageCache sharedImageCache]cleanDisk];
????}
???????Ч????