Re: Retrieving "default" defaults after registerDefaults?
Re: Retrieving "default" defaults after registerDefaults?
- Subject: Re: Retrieving "default" defaults after registerDefaults?
- From: Doug Brown <email@hidden>
- Date: Sun, 7 Apr 2002 14:36:12 -0700
Hi Matt,
Have you tried this?
[[NSUserDefaults standardUserDefaults]
removeObjectForKey:@"DefaultsKey"];
You could repeat that for each of your keys. I believe this deletes the
user's chosen default, which would make the app go back to your default
value.
If you wanted to remove all the defaults for your app, I think you could
do:
- removePersistentDomainForName:@"yourBundleIdentifier"
I'm not totally sure and I'm definitely not an expert at Cocoa, so you
might want to test this with a smaller app first to make sure it works.
Doug
On Sunday, April 7, 2002, at 01:49 PM, Matt Gemmell
<email@hidden> wrote:
My question is, can I programmatically access the original "default"
values
I registered, so that I can elegantly implement a "Factory Settings"
button
in my preferences window? I want to retrieve the "default" values I
initially registered before reading the actual values the user had
saved, so
that I can reset my app's settings to their factory state. I hope that
makes
sense.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.