Does UIImageView requires memory when it is hidden?
Same question for alpha=0.0
I work a lot with hidden images, and I wonder if those still consume memory.
More specifically I would like to know that for tableview.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Of course if it has an image loaded into the view, it does, because
UIImageViewis simply aUIViewthat has aUIImage@property with theretainattribute so it retains the image.The fact that the view is visible or not does not change anything of course, and hopefully because otherwise iOS couldn’t load the
UIImageagain if you set theUIImageViewvisible again (once theimageproperty is affected to theUIImageView, theUIImageViewcan’t know the source of the image, was it loaded from a file, an URL, generated programatically, …?), and even if it did know it would be a pain to reload it (could take some time to load and decode)If you don’t use an
UIImageView‘s image, at least set itsimageproperty tonilto hide it (and reload/reaffect the image again yourself if you need to redisplay it, but if it is used in aUITableViewbecause of the recycling/reuse mechanism of theUITableViewCellsit will probably never be the same image to set anyway)