views:

39

answers:

1

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

+2  A: 

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.

deanWombourne
Hello thanks for ur answer but where i can put this code Now i'm googling it
Bobj-C
Put it wherever you want - I don't know how your app is structured so I can't really help! Put the first line of code each time the user gets further on in the story and the second line of code whenever you want to check where to start the story from again.
deanWombourne