I’m using ARC + Storyboard.
I’m not using segues, or a UINavigationController, but rather presenting each individual view with:
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
SecondViewController *secondViewController = [storyBoard instantiateViewControllerWithIdentifier:@"SecondVC"];
[self presentViewController:secondViewController animated:YES completion:nil];
So, a typical flow of my App is:
MainViewController
presentViewController:
SecondViewController
presentViewController:
ThirdViewController
…etc
After moving forward, I don’t want the previous view controller that I presented from hanging around in memory any more.
Right now, after I move on to my second view controller, I can put a break point in a timer function in MainViewController, and verify everything is still there.
Note : viewcontroller is
automatically retainedwhenpresentViewController:,but in ARC it will handle retained object and will release it when appropriate .Calling
dismissModalViewControllerlater on willrelease the retained controller automatically.