Is there a way to clear the cache used by UIImage class? Is there a way to clear the cache used by UIImage class? ios ios

Is there a way to clear the cache used by UIImage class?


There is no way I know of to manually clear this iOS managed cache. In general, this is a red herring. When the os manages something for you, you don't need to worry about it. As long as you are correctly releasing anything you alloc/retain and handling memory warnings appropriately you're doing your part.


Answer taken from Kevin Low comment


If you can use private APIs (as in an AdHoc only app, for example) use this UIImage method to remove all images from cache

[UIImage _flushSharedImageCache];


The cache will be emptied when it needs to be, i.e. when the application receives a Low Memory Warning. There is no reason for you to do this yourself, and there is no public API available.