Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How persistent is [NSUserDefaults standardUserDefaults]?

I'm using [NSUserDefaults standardUserDefaults] for storing application settings.

My questions are:

  • do those settings are removed on app deletion?
  • are they kept after an application update (through the AppStore)?

Because I'm using it to store a password and don't want my users to reset them at each update. Also, I'd like that the only way to reset the password would be to remove the app and re-install it.

Is NSUserDefault the right choice?

Thanks, Jérémy

like image 441
jchatard Avatar asked Jun 28 '10 14:06

jchatard


1 Answers

Yes, they are removed on app deletion and yes they are kept when an application is updated.

However, you're not advised to store sensitive data in the NSUserDefaults, instead I would look at using the Keychain.

like image 108
Tom Irving Avatar answered Sep 28 '22 04:09

Tom Irving