tags:

views:

62

answers:

2

Hello all,

I am building up a game and want to give user a continue functionality when he restarts the application. So I want to know how to code or what to do to start an application where it left last time.

Is there any sample code available in app center which explains how can this be possible.

Tnx in advance.

+1  A: 

Use NSUserDefaults. I don't know how you're app is structured, but that way, you can store some amount of information when the app quits. Next time when you launch, you can check to see if a value exists (NSUserDefaults behaves like NSDictionary), and if it does, start up from there.

Jeff LaMarche has a tutorial on saving the state for tab bar controllers on his blog.

+1  A: 

I think you could use a form of persistent storage, like NSUserDefaults, where you could save the application's state, and reload it after each restart. I'm thinking about loaded Nib names and specific controls' properties, depending on your application's logic.

luvieere