I have initialized an delegate object in ViewDidLoad
of my ViewController, but when I am again loading it, it is initializing the value again.
I am saving some some sort of array in that delegate object which I want to access using getObject
and setObject
.
What should I do so that the delegate object doesn't get re-initialized every time ViewDidLoad
is called?
Have you considered this strategy:
However, when you use this strategy, you should be aware that that specific object's value should stay the same throughout your app's life cycle. Otherwise it won't work.