Re: NSWorkspaceDidTerminateApplicationNotification and background app
Re: NSWorkspaceDidTerminateApplicationNotification and background app
- Subject: Re: NSWorkspaceDidTerminateApplicationNotification and background app
- From: olivier <email@hidden>
- Date: Thu, 6 Feb 2003 09:10:12 -0600
Thanks for the idea, but that requires polling and i found a way
without polling. The background app publish a service via rendez vous
so whenever a my service disappear i ask the user what he wants to do...
Olivier
On Wednesday, February 5, 2003, at 06:38 PM, Alex Rice wrote:
On Wednesday, February 5, 2003, at 01:48 PM, olivier wrote:
I want to use that notification, to monitor a background only
application. Which seems not to work (it works fine with foreground
apps), is there a way to do what i want or should i poll regularly to
see if the app is still there.
Not sure why there would be a difference. Maybe the notification queue
is getting disabled when it's backgrounded?
However, if you just want to see if the app is there, maybe use NSPort
instead of Notifications? See the recent thread "Re: Only one loaded
executable...How ?" Something like this is working for me:
// in App (a)
NSPortNameServer *pns = [NSPortNameServer systemDefaultPortNameServer];
_dummyPort = [[NSPort port] retain];
[pns registerPort: _dummyPort name: PORT_NAME];
[[NSRunLoop currentRunLoop] addPort: _dummyPort forMode:
NSConnectionReplyMode];
// in App (b)
NSPortNameServer *pns = [NSPortNameServer systemDefaultPortNameServer];
if([pns portForName: PORT_NAME])
{
// we know app (a) is still there
}
Alex Rice <email@hidden> | Mindlube Software |
http://mindlube.com
what a waste of thumbs that are opposable
to make machines that are disposable -Ani DiFranco
_______________________________________________
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.