0

I'm developing an app that gets identification number and age at the first launch. I also want to use these values later on. Where should I save these values in?

Is it automatically saved?

My language is Swift.

DHK
  • 31
  • 3
  • Stash it in a file? Hard to answer without much more details... – vonbrand Aug 13 '15 at 17:16
  • 1
    Your needs seems rather simple so NSUserDefaults is probably good: http://stackoverflow.com/questions/28628225/how-do-you-save-local-storage-data-in-a-swift-application – Stefan Aug 13 '15 at 17:16
  • #Stefan Oh this is the right answer. Thanks. – DHK Aug 14 '15 at 07:09

1 Answers1

0

You can save them in NSUserDefaults,

NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
[def setObject:@"value:@"key"];
[def synchronize];
Adnan Aftab
  • 14,377
  • 4
  • 45
  • 54