Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-19-2010, 08:02 AM   #22 (permalink)
RLScott
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,549
RLScott is on a distinguished road
Default

Quote:
Originally Posted by wilky94 View Post
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
RLScott is offline   Reply With Quote
 

» Advertisements
» Online Users: 425
18 members and 407 guests
Absentia, apatsufas, brainspoon, comicool, Creativ, Davor, Domele, iMax 3060, jbro, JohnnyFlash, linkmx, matador1978, mistergreen2011, m_rozzi, NSString, revg, RickSDK
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,551
Threads: 94,078
Posts: 402,725
Top Poster: BrianSlick (7,990)
Welcome to our newest member, hongto24
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:18 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.