문제

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?

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top