-revertToInitialValues not 'taking'
-revertToInitialValues not 'taking'
- Subject: -revertToInitialValues not 'taking'
- From: Michael Hanna <email@hidden>
- Date: Wed, 25 May 2005 18:47:04 -0400
Hello all, I have an "default settings" NSbutton that is connected to the nsuserdefaultscontroller -revertToInitialValues in the MainMenu.nib. To instantiate the nsuserdefaultscontroller, I simply dragged it into the project from the IB Controllers palette. I'm not sure if this is the right way to do this. When I click this button, the plist does not get deleted(and when I restart the app I still have previous settings).
my +initialize:
<x-tad-smaller>+ (</x-tad-smaller>
<x-tad-smaller>void</x-tad-smaller><x-tad-smaller>)initialize
{
NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
...[setting various objects in the dictionary]...
[[NSUserDefaultsController sharedUserDefaultsController] setInitialValues:defaultValues];
}
</x-tad-smaller>
I also tried adding [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; but that didn't seem to make a difference either.. any ideas why it's not reverting to initial values and deleting the plist?
I looked at mmalc's Controlled Preferences example, and mine is set up rather similarly but my nsuserdefaultscontroller does not have the "yellow sign with the little man on it" on the side, it looks like it does in the palette. I have a feeling I didn't set things up quite right in IB but I'm not sure exactly what nor how to get it working properly. Would be even nicer if I could have it somehow automatically revert all the UI controls to their default state like in Controlled Preferences.. Any help would be appreciated.
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden