I'm new to developing for iOS. I've seen a lot of documentation about controlling memory management programmatically, however I'm curious about the default way iOS handles memory when navigating between:
- Tabs
- Master-Detail Views
- Master-Detail Views with Tabs
(Note: When I say a Master-Detail view, I am basically referring to a Navigation Controller. I'm just calling it a "Master-Detail View" to define two different levels of the Navigation Controller hierarchy, so its easier for us to discuss)
I will go through each of the 3 topics with the questions I have:
Tabs
- When the app first boots up, does it load all of the data into RAM for each of the tabs, or does it just load the data for the tab that is initially displayed?
- If the answer to 1 is no: Whenever you switch from one tab to another, does it deallocate the data of the tab you switched from?
- If the answer to 1 is yes: If the app needs to load data from a database in each of its tabs: does it just load the user interface / local functionality into RAM, and only load from the database data when that tab is selected (when this data is needed)?
Master-Detail view (in the case where the Master is a UITableViewController, and the Detail is just a UIViewController and they are embedded in a Navigation Controller)
- When you load a Detail View, then go back to the Master View, does the data from the Detail view still remain in RAM?
- When you load a Detail View, then go back to the Master View, then go into a different Detail view, does the first Detail view's data stay in RAM?
Master-Detail Views with Tabs (in the case where the Master is a UITableViewController, and the Detail is just a UIViewController and they are embedded in a Navigation Controller)
- When you load a Detail View, then switch to a different tab, is the Detail View's data still in the RAM?
- When you load a Detail View, then go back to its Master View, then switch tabs, is the data from the Detail View still in RAM?
All of these questions are referring to the default behavior of iOS.