I had a few memory issues with my app so I started investigate. Removed a few methods, profile -> instruments and again and again. I found a few major issues but my question is this, Right now I have a class with no code in it besides the basic import viewdidload etc (the build in lines you get when you create a new class. In the IB I’ve connected that class ViewController to another ViewController and I’m pushing my way back and forth. In instruments I can see that with every push I’m gaining 30-50kb to my app. How is that possible? Is that normal behavior?
I had a few memory issues with my app so I started investigate. Removed
Share
Segues create a new instance of the destination view controller each time. If you have two view controllers linked by segues in a storyboard, and you keep executing the segues, you will get more and more instances of each controller, so you would expect to see memory growth.
Look into unwind segues, or a navigation controller, or dismissing the presented view controller to go “back”.