• 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
login items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

login items


  • Subject: login items
  • From: Tavis <email@hidden>
  • Date: Mon, 3 Nov 2003 03:58:35 -0800

Any idea why my code is writing to my apps .plist instead of the
logwindow.plist?
Its all working fine, it's just writing the data to the wrong plist
file.

Heres my code:

-(void)addAppToLoginItems
{
NSMutableDictionary * myDict=[[NSMutableDictionary alloc]init];
NSUserDefaults * defaults = [[NSUserDefaults alloc] init];
NSMutableArray * loginItems;

[defaults addSuiteNamed:@"loginwindow"];

[myDict setObject:[NSNumber numberWithBool:NO] forKey:@"Hide"];
[myDict setObject:[[NSBundle mainBundle] executablePath]
forKey:@"Path"];

loginItems=[[NSMutableArray arrayWithArray:[[defaults
persistentDomainForName:@"loginwindow"]
objectForKey:@"AutoLaunchedApplicationDictionary"]] retain];

[loginItems removeObject:myDict];

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

[loginItems autorelease];
return 0;
}
_______________________________________________
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.

  • Prev by Date: Re: Linking to libcrypto
  • Next by Date: Re: NSButtonCell in NSTableView: How can I define button action?
  • Previous by thread: Re: Rendezvous not resolving on Panther, when compiled on Panther
  • Next by thread: Re: NSButtonCell in NSTableView: How can I define button action?
  • Index(es):
    • Date
    • Thread