Quote:
Originally Posted by okc.engineer
Several times when I have removed an app from my iPhone, and later reinstalled it, I have found that, even with the app having been removed, the user default information was still there when the app was restored.
I'd like to do that for my Enterprise app. It has a couple of fields saved to NSUserDefaults, but if my app is deleted from the iPhone and then reinstalled, the NSUserDefault fields have to be re-entered. What I would like to do, similar to the commercial apps I have used, is to have that information reside essentially permanently, available if the app is deleted and re-installed, unless and until the phone is wiped.
My reason for doing this is to eliminate a means of falsifying information. Some of our employees, unfortunately, may sometimes be tempted to make changes in their information in order to cover up some time sheet inaccuracies. Making it virtually impossible -- or at least extremely difficult and inconvenient -- would prevent some of that data misrepresentation.
Is there a way to do this?
Thanks!
|
It's my understanding that user defaults (NSUserDefaults) gets deleted when you delete an app.
There's another facility, the keychain, that lets you save encrypted information.
The keychain has the facility to save information for a suite of applications.
Say your company, FooSoft, has a family of accounting programs.
Say the bundle name for your apps starts with
com.foosoft.accounting
Then say you have apps
com.foosoft.accounting.gl (general ledger)
and
com.foosoft.accounting.ar (accounts receivable)
You could save keychain info
with the bundle id com.foosoft.accounting, that would be available to all the apps in the com.foosoft.accounting family, and not deleted if you deleted any of the apps in the family.
You should be able to use the keychain to save your information that way, so that deleting a single app does not delete the info.
Disclaimer: I haven't actually done this, just read about it.