Hi,
I am using the NSUserDefaults
' api -registerDefaults
api to register the factory defaults of my application. All is fine for the first version of the application. But when I provide an update for the iPhone application, I have 3 criteria to make sure:
- The user preferences of older version app should be intact.
- Addition to the factory defaults specific to the new version should be applied.
- Providing flexibility in the design to the future version updates so that the user defaults modifies itself based on the new version.
The api -registerDefaults
does not register factory defaults in new version updates because a plist file containing user preferences already exists in the /Library/Preferences of sandbox. And in case if we reset the preferences with new factory defaults, user preferences of previous version will be lost.
I think there should be a design pattern to handle such cases, so in general how do we cater with such situations? Doesnt Apple provide any inherent support for this? Or am I missing some links, I tried googling around without any success.
Thanks, Raj