• 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
NSWorkspaceWillPowerOffNotification from a daemon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWorkspaceWillPowerOffNotification from a daemon


  • Subject: NSWorkspaceWillPowerOffNotification from a daemon
  • From: Matthew Mashyna <email@hidden>
  • Date: Thu, 12 Mar 2009 20:11:30 -0400

I have a daemon that gets started from /Library/LaunchDaemons. It monitors the system and alerts another remote machine when certain status changes. What I want to monitor is when the machine powers on and off, sleep, monitor sleep.

Everything works fine except catching the shutdown. I make these calls to keep tabs on things:

[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWillPowerOff:) name:NSWorkspaceWillPowerOffNotification object:nil];
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWillSleep:) name:NSWorkspaceWillSleepNotification object:nil];
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWokeUp:) name:NSWorkspaceDidWakeNotification object:nil];


The sleep calls work fine but the PowerOff doesn't work ever. Is there another way to catch shutdown ? Can I catch some signal to handle it ?

Thanks,
Matt



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSWorkspaceWillPowerOffNotification from a daemon
      • From: Dave Keck <email@hidden>
    • Re: NSWorkspaceWillPowerOffNotification from a daemon
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: code for drawing an NSTextField to a panel window ...
  • Next by Date: Re: NSWorkspaceWillPowerOffNotification from a daemon
  • Previous by thread: RE: NSTableView live resizing glitch
  • Next by thread: Re: NSWorkspaceWillPowerOffNotification from a daemon
  • Index(es):
    • Date
    • Thread