Re: Wake from sleep notifications and preventing idle sleep
Re: Wake from sleep notifications and preventing idle sleep
- Subject: Re: Wake from sleep notifications and preventing idle sleep
- From: Philip Dow <email@hidden>
- Date: Wed, 22 Mar 2006 17:50:48 +0100
Ha neat! I never came across that in the documentation. Well, for
anyone interested in this topic, I'd suggest going with that solution
unless you need control over idle sleep or need to customize those
notifications in some other way.
-Phil
On Mar 21, 2006, at 9:15 PM, Dan Messing wrote:
When I first tried to use the NSWorkspaceDidWakeNotification and
NSWorkspaceWillSleepNotification notifications I also ran into
problems because I didn't realize that I had to register with
NSWorkspace's notification center instead of the
defaultNotificationCenter:
[[NSWorkspace sharedWorkspace] notificationCenter]
instead of:
[NSNotificationCenter defaultCenter]
Of course your solution has already solved the problem for you, I
just wanted to add this in case anybody else was running into the
same problem.
Dan Messing
Stunt Software
http://www.stuntsoftware.com/
On Mar 21, 2006, at 1:58 PM, email@hidden wrote:
I've never beeng able to get the NSWorkspaceDidWakeNotification to
work, and I was going to post to the list asking about this but first
did some extra research and came up with a wrapper class that
provides the functionality I was looking for.
Since this may be useful to others, I'd like to share it. The class
also happens to be the first entry in what I hope to be a useful
database of cocoa code that I've recently written.
The class posts a notification when the computer is about to sleep or
when waking from sleep. It also implements a delegate method that can
prevent idle sleep from happening, if for example your program needs
to complete a lengthy operation without being interrupted.
For more info about the class: http://developer.phildow.net/cocoa-
code/pdpowermanagement/
Feel free to use it in any way you can.
-Phil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden