user3568907
user3568907

Reputation: 337

When the app is deleted what happens to the values stored in NSUserDefaults?

I have a little question regarding NSUserDefaults. When the application is deleted, what happens to the values stored in the NSUserDefaults? Do they get deleted as well?

When I remove a app and reinstall it from the app store the previous NSUserDefaults values are loaded?

Upvotes: 12

Views: 7087

Answers (1)

Robert J. Clegg
Robert J. Clegg

Reputation: 7360

When an app is deleted from the device all local data associated with the app will be deleted too. This includes NSUserDefaults. However any data stored at an online service won't. For example, iCloud. The app will just fetch the data again if requested to do so by the user / developer.

Edit

As per mAu's comment below - this includes keychain data, which won't be deleted either.

Upvotes: 17

Related Questions