Re: Regarding launching an application at startup of mac.
Re: Regarding launching an application at startup of mac.
- Subject: Re: Regarding launching an application at startup of mac.
- From: Ryan McGann <email@hidden>
- Date: Mon, 22 Jan 2007 17:38:21 -0800
On Jan 22, 2007, at 11:54 AM, Sean McBride wrote:
On 2007-01-22 17:45, Finlay Dobbie said:
Or instead of e-mailing DTS, you could just download it from ADC:
http://developer.apple.com/samplecode/LoginItemsAE/index.html
Yes, much better. :) Once upon a time the code was only given
out upon
request.
That code is somewhat unsupported and broken
On current OSes? I am aware of problems on future OSes....
Mucking with the plist is as unsupported as the API itself. But since
Tiger and below are basically dead development-wise, I doubt that
Apple is going to remove this functionality. In Leopard you can (and
probably should) use LaunchAgents but Apple has not indicated that
loginwindow AutoLaunch items will go away. Yet.
I only suggested editing the plist yourself because anybody with
experience in Cocoa can write better code than the originally example
code from DTS. It used CFPreferences to read write the file whereas a
Cocoa application could do it in about 5 lines of code (at least ours
does).
, and it is generally
recommended that you migrate to the approach taken in the newer
sample.
Which is the newer sample?
The newer sample code has problems as well; mainly that it uses Apple
Events and therefore cannot be run in a daemon/background process
easily (because Apple forbids daemons from linking to
ApplicationServices, which the Apple Events framework lives in).
Ryan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden