Setting uiimage to nil doesn't release memory with ARC

前端 未结 1 1278
遇见更好的自我
遇见更好的自我 2021-01-05 18:34

I have a scrollview that shows different images as it\'s scrolled through the pages, like PhotoScroller. I\'m using ARC. When someone scrolls to another page, I set the im

相关标签:
1条回答
  • 2021-01-05 19:34

    The UIImage's for the pages are all held in an array.

    The UIImage's are not being deallocated when you set the UIImageView's property to nil because the array is still holding a reference to them. As for the memory growth, it may be something else that is being allocated. I'd suggest taking a look with Instrument's object allocation instrument to track down what exactly is growing as you scroll.

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