site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com While AppKit shouldn't be used in a global context daemon, you can always have a user-context agent and use something to communicate between the agent and the daemon (nsmachport...). But that's a really ugly solution to the problem. What is the mechanism used by NSWorkspace exactly ? What is the proper answer to the original question, ie getting the shutdown event in a global context daemon ? - Antoine On 2011-03-23, at 17:11, Quinn The Eskimo! wrote:
On 23 Mar 2011, at 18:03, Jerry Krinock wrote:
The suggestion there is to use NSWorkspaceWillPowerOffNotification.
NSWorkspace is not the droid you're looking for. AppKit sends it in response to a 'quit' Apple event that has the 'why?' attribute, implying that the app is being quit by loginwindow in preparation for restart or shutdown. This doesn't really help you.
When you say "started automatically by launchd", do you mean the global system launchd (that is, pid 1) or some per-user launchd? If you're started by the global launchd, you're running in a daemon context and you should not be linking with AppKit (per the rules outlined in Technote 2083 "Daemons and Agents").
<http://developer.apple.com/library/mac/#technotes/tn2005/tn2083.html>
S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/antoine.missout%40metak...
This email sent to antoine.missout@metakine.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com