• 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: Matt Judy <email@hidden>
  • Date: Thu, 04 Jul 2002 00:23:04 -0700

It should also be noted that using this code...

NSUserDefaults *df = [NSUserDefaults standardUserDefaults];
NSDictionary *dd = [df persistentDomainForName:@"loginwindow"];

...dd contains the loginwindow prefs. The extra alloc/init, and addsuitenamed, appears to be unnecessary.

--Matt

Matt Judy wrote:
Pierre-Olivier Latour wrote:

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

Has no effects...

Any idea?


Actually, yes. Try adding a line:

[defaults removeObjectForKey:@"AutoLaunchedApplicationDictionary"];
[defaults setObject:loginItems forKey:@"AutoLaunchedApplicationDictionary"];
[defaults synchronize];

I don't know why, but sometimes, I've found I have to remove the object before setting a new one will have an effect.

--Matt
_______________________________________________
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.
_______________________________________________
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.

References: 
 >Re: Installing a new login item? (From: Pierre-Olivier Latour <email@hidden>)
 >Re: Installing a new login item? (From: Matt Judy <email@hidden>)

  • Prev by Date: Combo box doubts
  • Next by Date: Re: Combo box doubts
  • Previous by thread: Re: Installing a new login item?
  • Next by thread: [solved] Programatically adding/removing menu items
  • Index(es):
    • Date
    • Thread