Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unwind segue does not release my view controllers

I have something like this:

My rootViewController is a navigationBar - let this be A. The rest are normal UIViewControllers, and are programmatically segue via push (through a button IBAction method).

Flow diagram

However going from D -> A, I use unwind segue (also via performSegueWithIdentifier:sender:).

The issue here is that when the segue is performed, B, C and D are not deallocatedat 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?

like image 603
CyberMew Avatar asked Dec 05 '25 08:12

CyberMew


1 Answers

-(void)viewWillDisappear:(BOOL)animated{
    [timer invalidate];
    timer = nil;
}

Hope this will help you...for timer invalidate on other controller

like image 152
Arvind Kumar Avatar answered Dec 07 '25 22:12

Arvind Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!