Problem dealloc'ing memory used by UIImageViews with fairly large image in an UIScrollView

前端 未结 7 1830
遥遥无期
遥遥无期 2020-12-03 03:58

I have a large UIScrollView into which I\'m placing 3-4 rather large (320x1500 pixels or so) UIImageView image tiles. I\'m adding these UIImageViews to the scroll view insi

相关标签:
7条回答
  • 2020-12-03 04:44

    It could be the system caching references to your images in memory, assuming you have just drug in the images from the media browser in IB the code underneath is probably using the UIImage imageNamed: method...

    You could try loading all the images with imageWithContentsOfFile: , or imageWithData: and see if it behaves the same (dragging in unfilled UIImageViews in IB and setting contents in viewDidLoad:).

    Read the UIImage class reference if you'd like a little more detail, it also describes which methods are cached.

    If it's the cache it's probably OK though as the system would free it if needed (did you also try hitting the Simulate Memory Warning in the simulator?)

    0 讨论(0)
提交回复
热议问题