-1

I have an app that contains 7 screens. First screen is Login screen. After successful login, I change the root view controller to Home Screen in AppDelegate.

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
HomeViewController *objHomeScreen  = [storyboard instantiateViewControllerWithIdentifier:@"HomeViewControllerSID"];    [self.window setRootViewController:objHomeScreen];

Now Home screen will be presented. Next, after 3 controllers again I change rootViewController. Now my question is, will the 3 controllers exist in memory after changing the rootViewController?

Yash Tamakuwala
  • 1,789
  • 1
  • 24
  • 33

1 Answers1

0

Theoretically yes, the memory management will dispose those controllers, although you can ran into some issues as it is explained in this other thread of questions Changing the root view controller is not deallocating the previous view controllers on the same window you can read the questions and answers here to have a better understanding of the memory management

Samuel Chavez
  • 768
  • 9
  • 12