Question

In my view controller's viewDidLoad method (which is only called once, unlike viewDidAppear), I'm making a network request for data. Whenever I switch views and return to the first view, I've noticed that even though data is not being pulled again, the old data still displays on the screen. I'm not using Core Data, so where is this data being stored? Why use Core Data if data is already persistent apparently?

No correct solution

OTHER TIPS

If your views are embedded in a Navigation Controller or a Tab controller, then when you present another screen your first screen (and the Views and View Controller that make it up), are not taken out of memory, unloaded, destroyed, etc. The views are just rendered invisible (removed from view hierarchy). When you dismiss whatever "next" screen you're showing, you return back to the same still-existent original. It's re-displayed, not re-created. Everything about it's state is left exactly where it was at the point where you presented another view controller on top of it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top