• 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: Adding something to the login items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding something to the login items


  • Subject: Re: Adding something to the login items
  • From: sinclair44 <email@hidden>
  • Date: Sun, 13 Apr 2003 11:07:28 -0400

On 4/13/03 10:27 AM, "Arthur VIGAN" <email@hidden> wrote:

> I tried this, but I can't add a dictionnary to the
> "AutoLaunchedApplicationDictionary" array, as it is not a mutable
> array. I used the following code:
>
> NSUserDefaults *loginDefaults = [[NSUserDefaults alloc] init];
> NSDictionary *loginWindowDict = [NSDictionary
> dictionaryWithDictionary:[loginDefaults
> persistentDomainForName:@"loginwindow"]];
> NSMutableArray *loginItemArray = [NSArray
> arrayWithArray:[loginWindowDict
> objectForKey:@"AutoLaunchedApplicationDictionary"]];
> NSDictionary *myDict;
>
> myDict = [NSDictionary dictionaryWithObjects:[NSArray
> arrayWithObjects:@"/Volume/Arthur/rien", [NSNumber numberWithBool:1],
> nil] forKeys:[NSArray arrayWithObjects:@"Path", @"Hide", nil]];
>
> [loginItemArray addObject:myDict];
>
> but it doesn't work. Where am I wrong?

The line:
> NSMutableArray *loginItemArray = [NSArray arrayWithArray:[loginWindowDict
objectForKey:@"AutoLaunchedApplicationDictionary"]];

Assuming I'm understanding what you're doing, that should be:
> NSMutableArray *loginItemArray = [NSMutableArray
arrayWithArray:[loginWindowDict
objectForKey:@"AutoLaunchedApplicationDictionary"]];

An NSMutableArray variable isn't mutable if it holds an NSArray.

--

-- sinclair44

[self becomeWorldDictator];

- (void)becomeWorldDictator
{
[self coverLegalButt];

[[GeorgeBush principalClass] assassinate:[world currentLeaders]];
[[BinLaden principalClass] terrorize:[world citizens]];
[world setCurrentLeaders:[NSArray arrayWithObject:self]];
}

- (void)coverLegalButt
{
/* The above does not reflect any plans, expressed or implied, real or
imaginative, to kill or assassinate anyone, or to harm anyone in any shape,
way or form. Any relation to actual events is purely coincidental. */
}
_______________________________________________
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: Adding something to the login items (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: Re: Move Camera in OpenGL ?
  • Next by Date: Re: Attaching data to image files
  • Previous by thread: Re: Adding something to the login items
  • Next by thread: Re: Adding something to the login items
  • Index(es):
    • Date
    • Thread