i have a game that contain two viewcontroller, when the user end the game in viewcontrollerA his score is passing to viewcontrollerB that check if the user correct score is bigger that the high score and if it does the high score change to the user correct score. now, i succeeded to passing my var value forward but now i want to show the high score in a label on viewControllerA. i tried to use a @property(like i do to pass the correct score to viewcontrollerB) but i didn’t succeeded. how can i do it?
Share
I’d say what you are really looking for is
NSUserDefaults.You use it to store Data persistently, across ViewControllers and even across App-Restarts.
For example what you do is:
to store a value.
And once you want to read it (maybe after the app is restarted, in the
viewDidLoadmethod of some viewcontroller, you would do: