launchd agents
launchd agents
- Subject: launchd agents
- From: Keith Duncan <email@hidden>
- Date: Sat, 11 Nov 2006 21:13:48 +0000
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:
This email sent to email@hidden