I understand that, besides some general settings, an iOS app can only see the contents in the [NSUserDefaults standardUserDefaults] that itself created. I guess the OS is looking at the app’s identifier to ensure this, right?
What I want to know is if there is any way another applications could gather information that my app stored in the user defaults.
I understand that, besides some general settings, an iOS app can only see the
Share
Other apps would not be able to access information saved in your user defaults for your app. But this doesn’t mean the information can’t be obtained. You can plug your device into Xcode and run your app. Under devices, you can view your own app’s information, and the information saved in user defaults will be listed there.
It generally isn’t a good idea to save sensitive user data there, while not that easy to access, it is still accessible. For general non-personal data or settings, it really isn’t a big issue. You can always use the built-in keychain access to store username and password information and use user defaults for anything else you might need.
In one of my apps, I salt and hash the username and password together to create a unique token. I save that in user defaults. It is worthless by itself, but that is just my way of doing things. Good luck.