• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSWorkspaceDidTerminateApplicationNotification and background app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWorkspaceDidTerminateApplicationNotification and background app


  • Subject: Re: NSWorkspaceDidTerminateApplicationNotification and background app
  • From: Alex Rice <email@hidden>
  • Date: Wed, 5 Feb 2003 17:38:36 -0700

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.

  • Follow-Ups:
    • Re: NSWorkspaceDidTerminateApplicationNotification and background app
      • From: olivier <email@hidden>
References: 
 >NSWorkspaceDidTerminateApplicationNotification and background app (From: olivier <email@hidden>)

  • Prev by Date: Re: Missing inactive and disabled states on some controls
  • Next by Date: Re: Objective-C in signal handlers (was Re: Inter process communication question)
  • Previous by thread: NSWorkspaceDidTerminateApplicationNotification and background app
  • Next by thread: Re: NSWorkspaceDidTerminateApplicationNotification and background app
  • Index(es):
    • Date
    • Thread