NSWorkspaceWillPowerOffNotification from a daemon
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