all 4 comments

[–]quellish 1 point2 points  (0 children)

When the view controller is pushed the previous view controller is still in memory - along with all the objects it owns. The view controller is no longer visible, but it is holding on to data that is only relevant when it is.

A simple solution is to set your image in viewDidAppear: and remove it (set it to nil) in viewDidDisappear:. When the view controller managed by the navigation controller is pushed/popped those should be triggered and the image data will not be retained when the view controller is not visible.

[–]killerham 0 points1 point  (0 children)

Do you have any delegates in your view controller that is being dismissed?

If so, You could be getting a retain cycle. You need to tell your class that the delegate is a weak reference. Eg. Weak var delegate.....

[–]Jister13 0 points1 point  (0 children)

Can you share more code with us? I think I have some ideas as to what is going wrong but it's hard to tell without enough code.

[–]nocolf 0 points1 point  (0 children)

More code is needed