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



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

On 11/11/06, Keith Duncan <email@hidden> wrote:
Hi,
        I've written a launchd agent that displays a small GUI. My main
function is as follows:

int main (int argc, const char *argv[]) {

     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

        NSApplicationLoad();

        registerCallback();

        theAgent = [[Agent alloc] init];

        [[NSRunLoop currentRunLoop] run];
        //[[NSApplication sharedApplication] run];

     [pool release];
     return 0;
}

Now, this works i.e. the window that theAgent creates is displayed
when running under Xcode and launchd - but the window's button's
don't respond at all. Using the NSApplication method allows the
buttons work but, and here's the problem, it crashes when launched
under launchd after you logout and back in again! I mean to say that
the first time I login it works, after that it doesn't and requires a
restart for it to run under launchd again without crashing.

So what I'm looking for is an 'official' way to display a GUI in a
launchd agent as neither of my methods work. Any help would be much
appreciated.

- Keith.
 _______________________________________________
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

_______________________________________________
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>)



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.