• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSDefaults to CFPreference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSDefaults to CFPreference
      • From: Thomas Harrington <email@hidden>
  • Prev by Date: compress/decompress - gzip and gunzip using cocoa
  • Next by Date: simple Python shell
  • Previous by thread: Re: compress/decompress - gzip and gunzip using cocoa
  • Next by thread: Re: NSDefaults to CFPreference
  • Index(es):
    • Date
    • Thread