• 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
Re: Wake from sleep notifications and preventing idle sleep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Wake from sleep notifications and preventing idle sleep (From: Dan Messing <email@hidden>)

  • Prev by Date: Re: XCode 2 upgrade problems... multiple methods with the samenameerrors
  • Next by Date: Re: XCode 2 upgrade problems... multiple methods with the samenameerrors
  • Previous by thread: Re: Wake from sleep notifications and preventing idle sleep
  • Next by thread: folder monitoring...
  • Index(es):
    • Date
    • Thread