Re: NSWorkspaceWillPowerOffNotification from a daemon
Re: NSWorkspaceWillPowerOffNotification from a daemon
- Subject: Re: NSWorkspaceWillPowerOffNotification from a daemon
- From: Dave Keck <email@hidden>
- Date: Thu, 12 Mar 2009 16:12:23 -1000
It seems your situation is similar to this:
http://lists.apple.com/archives/macnetworkprog/2007/Aug/msg00017.html
I just tested, and a normal (non-daemon) Cocoa app _does_ receive the
power-off event. It sounds like daemons in particular have an issue
receiving it.
It appears that IOKit has something called
"kIOMessageSystemWillPowerOff". Check out
/Developer/Examples/IOKit/FireWire/FWLib. You'll probably need to
change the project to write the output to a file, or something. Once
you've done that, shut down your computer. When you reboot, whatever
log file was created should mention something about
kIOMessageSystemWillPowerOff.
How does this suite your needs? It's definitely not as elegant as
NSNotifications, but it's probably more robust.
David
_______________________________________________
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