IPhone : memory leak when using images in Swift?

on Thursday, March 26, 2015

I have a very simple app with two viewControllers at the moment. I have a transition between them (with a segue of course) and both screens have a lot of images and buttons with images.


What I discovered was that there is a memory leak when you alternate between the screens. I am guessing, that somehow the images are loaded again each time you open the viewController again. Around 6MB is added each time and I am pretty sure that the images are less than 1MB in total. So maybe there is something else craving all the memory?


So my question would be: what is causing this problem (and preferable how can I fix this)? Is it the images, or maybe the segues with the transition.


Any help would be really appreciated! Thanks!


0 comments:

Post a Comment