• 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
Re: Installing a new login item?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installing a new login item?


  • Subject: Re: Installing a new login item?
  • From: Pierre-Olivier Latour <email@hidden>
  • Date: Wed, 03 Jul 2002 14:28:33 +0200

>> NSUserDefaults * defaults = [[NSUserDefaults alloc] init];
>
> with this:
>
> NSUserDefaults *defaults = [NSUserDefaults standardDefaults];

Yes, you have to add domains where NSUserDefaults can look for keys. Using
standardDefaults add the "standard" list of domains.

Or you can use:
NSUserDefaults * defaults = [[NSUserDefaults alloc] init];
[defaults addSuiteNamed:@"loginwindow"];

To look only into the "loginwindow" domain.

However, the code still doesn't work for me...
[defaults objectForKey:@"AutoLaunchedApplicationDictionary"]
Returns an array of 0 entries instead of 7 ones (as indicated in [defaults
persistentDomainForName:@"loginwindow"]).

However, this works of course:
[[defaults persistentDomainForName:@"loginwindow"]
objectForKey:@"AutoLaunchedApplicationDictionary"]

But once the dictionary is edited, calling:
[defaults setObject:loginItems forKey:@"AutoLaunchedApplicationDictionary"];
[defaults synchronize];

Has no effects...

Any idea?

Right now, I'm modifying the loginwindow.plist file directly: it works fine,
but it's not clean.

_____________________________________________________________

Pierre-Olivier Latour email@hidden
Manager and Lead Programmer
French Touch software http://www.french-touch.net

Cool source code: http://www.french-touch.net/CodeWareHouse
_______________________________________________
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: Installing a new login item?
      • From: Matt Judy <email@hidden>
    • Re: Installing a new login item? - Code that works!
      • From: Pierre-Olivier Latour <email@hidden>
References: 
 >Re: Installing a new login item? (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: NSEnumerator ordering ?
  • Previous by thread: Re: Installing a new login item?
  • Next by thread: Re: Installing a new login item? - Code that works!
  • Index(es):
    • Date
    • Thread