F
F
furyon2018-10-13 01:41:35
iOS
furyon, 2018-10-13 01:41:35

Can iOS clear class property values?

Hey!
We are talking about an application for iOS on swift.
Let's say there is a class with a static field: static var cache = [Int, Int]().
As you use the application, data is added to this field.
Question: can I be sure that even after a long idle time (in the background), when the application is restored, only 2 options are possible:
1. The application will start again;
2. The state of the cache field will remain the same.
Those. there cannot be a situation when I opened the application on the last view controller, but the class field was cleared.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doublench21, 2018-10-13
@furyon

If you really have such a cache as you showed, then this is terrible.
In fact, the property itself cannot be cleared. Either the system will see fit and completely throw your application out of memory, or you will return as if nothing had happened.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question