How to temporarily change all default user settings without destroying the original?
- by mystify
My app is based strongly on a lot of NSUserDefault keys and values.
I want to implement a temporary defaults profile which the user can activate to get a special task done easily. For this, some of the user defaults must be changed temporarily so the app adjusts it's interface appropriately.
I started to just manually change those NSUserDefaults settings, but this also destroys the user's original settings.
Is it possible to keep a backup of the user's NSUserDefault settings and restore them after the user quits the temporary mode or the app?
Like I see it, NSUserDefaults actually is just an NSMutableDictionary which is generated out of a plist file. So I would just make a deep copy of that and later assign that copy somehow back to NSUserDefaults?