How can I control the potential endless push of view controllers on the navigation controller stack? IOS

I have an application consisting of a UINavigationController that pulls ViewControllers from three different tabs.

The problem that I foresee is that the existing structure allows the user to infinitely add VC to the stack.

I have a tab called pharmaceuticals and the other is called pathogens. If you go far enough in pharmaceuticals, you will be put on the list of pathogens against which it is effective, and the user can select a pathogen for more information about this. This forces the application to click the new pathogenVC.

Now the user can go to the list of pharmaceutical preparations to which the pathogen is susceptible and select it, which causes the appearance of a new VC in the pharmaceutical preparations tab.

etc. etc.

each time another 1.5 MB is added to the memory area.

How can I do this best?

+4
source share
2 answers

You should focus on minimizing the memory footprint by releasing resources that you can easily recreate, rather than trying to stop using 100 view controllers on your stack. Apple doesn't do that either.

"iTunes Store" " ", "Let Them Talk", "Hugh Laurie", "Let Them Talk", "Hugh Laurie", . , . , , , .

20 Toyota Pickup, , , Capri Sun. IMHO, , , .

enter image description here

, , , , , . didReceiveMemoryWarning (: didReceiveMemoryWarning?), , (, Core Data ..). , , , , , . .

+5

UINavigationController. pushViewController:animated: popViewControllerAnimated:. ( ), - , , . , , , - .

. , .

+1

All Articles