CyberMew CyberMew - 1 year ago 71
Objective-C Question

Unwind segue does not release my view controllers

I have something like this:


is a
- let this be A. The rest are normal
, and are programmatically segue via push (through a button

Flow diagram

However going from D -> A, I use unwind segue (also via

The issue here is that I when the segue is performed, B and C and D is not
at all. Not only is this causing a memory leak issue but my timers are still running. I'm not sure why this is the case. I thought unwind segues are suppose to handle all these for you? Any idea why?

Answer Source

The issue is with the NSTimer.

NSTimer retain their target. So if a view controller starts a timer with target:self, it will not be deallocated as long as the timer is running.

You can get more information here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download