Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launchd agents



Thanks for your reply. Maybe this will have been fixed by Leopard.

In the interim I've actually found a solution, albeit a less elegant one. I've moved all of my GUI code into a separate application target that I launch using NSTask when user input is need, the .app has LSBackgroundOnly set in its plist so the entire procedure is still invisible to the end user as I had intended. Piping data back into the Agent is then simple using the existing NSConnection I setup to recieve data from other Apps.

The only code I could get to work to launch the external app is:

NSTask *app = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/open" arguments:[NSArray arrayWithObjects:@"-a", appPath, nil]];

Is there anyway to launch the app directly (without using /usr/bin/ open) so that I can retain a handle on it and terminate it after a timeout?


On 12 Nov 2006, at 09:41, Finlay Dobbie wrote:

As has been explained in the past on darwin-dev, LaunchAgents are
basically unusable in Tiger because of this. Your best solution will
be to use one of the other methods detailed in
<http://developer.apple.com/technotes/tn2005/tn2083.html>.

-- Finlay
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >launchd agents (From: Keith Duncan <email@hidden>)
 >Re: launchd agents (From: "Finlay Dobbie" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.