16

If I put a token (a string) into NSUserDefaults, lets say as a paramter passed to a REST API that is used by the app, and the app is uninstalled, will the string remain on the device?

barfoon
  • 27,481
  • 26
  • 92
  • 138

2 Answers2

29

No, it will not. I use NSUserDefaults in the exact same manner, and it will not stay after the app is deleted. You can verify this via Organizer if you need to.

It will however persist through updates. I have been using TestFlightApp for all of my beta testing, and the token (and other saved user default data) remains. Hope this helps.

Bill Burgess
  • 14,054
  • 6
  • 49
  • 86
  • 1
    +1 for the TestFlightApp. I didn't had the chance to test is properly, but it looks like something very neat. 10x. – Nicu Surdu Oct 19 '11 at 14:56
5

No. You can see that the data saved is in Library/Preferences/ inside your sandbox. If you are using Simulator, see (something like) ~/Library/Application\ Support/iPhone\ Simulator/4.3.2/Applications/00DB5581-E797-4AB0-9033-321ACD8938BD/Library/Preferences/com.me.MyApp.plist

David Dunham
  • 8,139
  • 3
  • 28
  • 41