There’s a UIViewController method -(void)viewDidUnload. I tried putting NSLog("unloaded"); in there to see when the view is unloaded, but nothing was printed to the console.
Where do I put my code, so that before a view unloads I can perform an action?
Are you using storyboard or not?
Have you tried any of this methods
or
If you are using storyboards the one that will that usually performs is viewWillDisappear.