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

后端 未结 4 1482
闹比i
闹比i 2020-12-06 09:22

It is well known that UIImage caches its image data when the image is loaded using the imageNamed: method.

From apple documentation: https://developer.a

4条回答
  •  忘掉有多难
    2020-12-06 09:34

    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];
    

提交回复
热议问题