login items
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.