Reputation: 578
I got some serious problems understanding the viewcontroller stack. When will my app use a stack to save the previous viewcontrollers? Only if I use a navigation viewcontroller or anytime I use normal viewcontrollers and segue modally between them?
So I was just wondering if I use some sort of chained routine for example, like going from vc 1 to vc 2 and from vc 2 back to vc 1. No navigation controller, just modal segues, no unwinding. Does my app got performance issues because of a stack (which will grow everytime I go around) or doesn't it make any difference?
----updated
So basicly this is my problem. If I went through the routine of the app, the views get stacked everytime I do a transtition.
Upvotes: 0
Views: 102
Reputation: 17958
UINavigationController
will retain any controller you push onto it's navigation stack until you pop it back off.
Any UIViewController
will retain a controller it presents modally until that child controller is dismissed.
In either case every controller will at a minimum consume some memory until you remove it. Apps which construct ever expanding stacks of controllers are likely to encounter a number of issues including:
I suspect that everyone will have a better experience if you view controller management matches whatever visual metaphor you are presenting to the user.
Upvotes: 2