jeudi 26 mars 2015

memory leak when using images in Swift?

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?


I have 6 image Views and I use the cross dissolve transition in the default modus. I wish I could copy some code here, but it is a big project and I would not know what code would be helpful.


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!




Aucun commentaire:

Enregistrer un commentaire