Re: Re: how to get an event (also name the event) when mac(universal i.e. or min 10.3.9 and above) wakes up from sleep mode

  • Thanks Sudheer...
    But Sudheer one more silly question where should I add this observer,
    because what i need is that whenever system awakes (and my application
    is running )one event shud be called and inside that event i wud use
    this code. I think u might have understood wht i mean to say.

    On 10/27/06, Sudheer dantuluri <sudheer...> wrote:
    >
    >
    > Hi Amit ,
    >
    > [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
    > selector:@selector(test)
    > name:NSWorkspaceDidWakeNotification object:nil];
    >
    > add the above observer and when ever your system awakes from sleep the above
    > selector gets called.
    >
    > - Sudheer.
    >
    >
    >
    > On 27-Oct-06, at 12:25 PM, Amit Jain wrote:
    >
    > Hi sherm,
    > As Iam new to this technology can you please give me a sample code to how to
    > implement this notification(NSWorkspaceDidWakeNotification)
    > in objective-c.
    > I am in trouble please help.
    > Regards...
    > Amit Jain
    >
    > On 10/26/06, Amit Jain <mailtoamit2410...> wrote:
    >
    >
    > thanks i ll try for this and update you soon.
    > Regards..
    > Amit Jain
    >
    > On 10/26/06, Sherm Pendley <sherm...> > wrote:
    >>
    >> On Oct 26, 2006, at 7:48 AM, Amit Jain wrote:
    >>
    >>> I have found one event (event pmgtwake) from this forum only but as
    >>> i have
    >>> gone thru it,
    >>
    >> What about NSWorkspaceDidWakeNotification?
    >>
    >> sherm--
    >>
    >> Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    >> Cocoa programming in Perl:
    > http://camelbones.sourceforge.net
    >>
    >>
    >>
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/<sudheer...>
    >
    > This email sent to <sudheer...>
    >
    >
    >
  • Add it to the class that you add as observer (as you pass self the
    class you call from) in it's init/awakeFromNib
    Then add a method test to that class (as you have test as the selector)

    -(void)test:(NSNotification)theNotification {
    ...
    }

    Am Oct 27, 2006 um 11:33 AM schrieb Amit Jain:

    > Thanks Sudheer...
    > But Sudheer one more silly question where should I add this observer,
    > because what i need is that whenever system awakes (and my application
    > is running )one event shud be called and inside that event i wud use
    > this code. I think u might have understood wht i mean to say.
    >
    > On 10/27/06, Sudheer dantuluri <sudheer...> wrote:
    >>
    >>
    >> Hi Amit ,
    >>
    >> [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
    >> selector:@selector(test)
    >> name:NSWorkspaceDidWakeNotification object:nil];
    >>
    >> add the above observer and when ever your system awakes from sleep
    >> the above
    >> selector gets called.
    >>
    >> - Sudheer.
    >>
    >>
    >>
    >> On 27-Oct-06, at 12:25 PM, Amit Jain wrote:
    >>
    >> Hi sherm,
    >> As Iam new to this technology can you please give me a sample code
    >> to how to
    >> implement this notification(NSWorkspaceDidWakeNotification)
    >> in objective-c.
    >> I am in trouble please help.
    >> Regards...
    >> Amit Jain
    >>
    >> On 10/26/06, Amit Jain <mailtoamit2410...> wrote:
    >>
    >>
    >> thanks i ll try for this and update you soon.
    >> Regards..
    >> Amit Jain
    >>
    >> On 10/26/06, Sherm Pendley <sherm...> > wrote:
    >>>
    >>> On Oct 26, 2006, at 7:48 AM, Amit Jain wrote:
    >>>
    >>>> I have found one event (event pmgtwake) from this forum only
    >> but as
    >>>> i have
    >>>> gone thru it,
    >>>
    >>> What about NSWorkspaceDidWakeNotification?
    >>>
    >>> sherm--
    >>>
    >>> Web Hosting by West Virginians, for West Virginians: http://wv-
    >> www.net
    >>> Cocoa programming in Perl:
    >> http://camelbones.sourceforge.net
    >>>
    >>>
    >>>
    >>
    >>
    >> _______________________________________________
    >> Do not post admin requests to the list. They will be ignored.
    >> Cocoa-dev mailing list      (<Cocoa-dev...>)
    >> Help/Unsubscribe/Update your Subscription:
    >> http://lists.apple.com/mailman/options/cocoa-dev/sudheer%
    >> 40effigent.net
    >>
    >> This email sent to <sudheer...>
    >>
    >>
    >>
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/<dominik...>
    >
    > This email sent to <dominik...>
    >
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today