Bobj-C
Bobj-C

Reputation: 5426

Save state of my app

Helllo all,

in my app there is a story 1 hour i want to know if the user exit the app in the half (time) of the story or any time then when he return i want to continue from where he left

any idea will be great

thanks

Upvotes: 0

Views: 156

Answers (1)

deanWombourne
deanWombourne

Reputation: 38475

Have a look at NSUserDefaults to store data between runs of your app. i.e.

[[NSUserDefaults standardUserDefaults] setDouble:time forKey:@"time"];

to save and

double time = [[NSUserDefaults standardUserDefaults] doubleForKey:@"time"];

to get the time back again.

Upvotes: 2

Related Questions