Quote:
Originally Posted by wilky94
Thanks to everyone. I got it working,..
|
But you still have not taken the very important advice of QuantumDoja in the very first response to your posting. You definitely should not use score.text as the primary storage of the value of the score. You will have trouble later on if you don't fix it now. You should store the score in an int value as part of some object other than the view. Perhaps the view controller, or even maybe the app delegate, if the score is essentially a global singleton.
For example, suppose you push another view controller onto the navigation stack and the system decided to unload the score view. That will destroy your one and only memory of the actual score. So when the view needs to be re-created the next time it loads, you won't have any value to put in for the score.
Or, suppose someone is playing your game and they get a phone call, which forces your app to exit. After the call, they return to your app, only to find that their score has disappeared. It is much easier to save the state of an int than to save the state of the text of a view.
Robert Scott
Ypsilanti, Michigan