NSDefaults to CFPreference
NSDefaults to CFPreference
- Subject: NSDefaults to CFPreference
- From: Rhon Fitzwater <email@hidden>
- Date: Fri, 8 Aug 2003 20:51:20 -0400
I need to change the code below to use CFPreference. I want my app to
use one system wide preference and not create a preference for every
user. I know that, and want, only admin users to be able to edit these
preferences. I am hoping that it will store the preference in
/System/Library/Preferences/.
Can anyone convert the code below or show me how?
Thanks,
-Rhon Fitzwater
Below is in: @implementation LogoutScreenSaverView
ScreenSaverDefaults *defaults = [ScreenSaverDefaults
defaultsForModuleWithName:@"LogOutScreenSaver"];
_Timer = [defaults integerForKey:LOGOUT_TIMER];
if (_kCMGCountdownLimit == 0)
{
_Timer = 5; //this should set default timer to 5 minutes
[defaults setInteger:_Timer forKey:LOGOUT_TIMER];
[defaults synchronize];
}
_Timer = [defaults integerForKey:LOGOUT_TIMER];
========================================================================
================
- (IBAction)closeSheet_save:(id)sender {
ScreenSaverDefaults *defaults = [ScreenSaverDefaults
defaultsForModuleWithName:@"LogOutScreenSaver"];
_Timer = [LogoutWaitSlider intValue];
[defaults setInteger:_Timer forKey:LOGOUT_TIMER];
[defaults synchronize];
[NSApp endSheet:configureSheet];
}
_______________________________________________
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.