Problem :
An application has 6 screens : A , B, C, D, E and setting screen. Each of screen has a button to go to setting screen. At Setting screen users can go to anywhere (except setting screen) . It means users can go A -> setting screen -> A -> setting screen -> A .... (whatever they want)
What's difficult:
In this case, the application will be out of memory to store all view controllers in the stack. And then ...crash.
How to resolve?
When users want to go other screen (A) from setting screen, please pop all view controllers to go to root View then go to other screen (A)
It means :
Users want : A -> setting screen -> C ->setting screen ->B (A is root view)
solution : A -> Setting screen --> popToRootView with option animation = NO to go to A --> C --> setting screen --> popToRootView with option animation = NO to go to A --> B
An application has 6 screens : A , B, C, D, E and setting screen. Each of screen has a button to go to setting screen. At Setting screen users can go to anywhere (except setting screen) . It means users can go A -> setting screen -> A -> setting screen -> A .... (whatever they want)
What's difficult:
In this case, the application will be out of memory to store all view controllers in the stack. And then ...crash.
How to resolve?
When users want to go other screen (A) from setting screen, please pop all view controllers to go to root View then go to other screen (A)
It means :
Users want : A -> setting screen -> C ->setting screen ->B (A is root view)
solution : A -> Setting screen --> popToRootView with option animation = NO to go to A --> C --> setting screen --> popToRootView with option animation = NO to go to A --> B