Solved: 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
Solved: 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
- Subject: Solved: 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
- From: "Amit Jain" <email@hidden>
- Date: Fri, 27 Oct 2006 15:53:34 +0530
Thanks Sudheer the problem is solved.
-Amit
On 10/27/06, Sudheer dantuluri <email@hidden> wrote:
Hi Amit ,
Whenever your system awakes , a notification is posted to the
NSWorkspace's notification center .
So , If your application is running and if it wants to know about
that , you need to add an observer to the NSWorkspace's
notificationCenter in your controller class and implement the
selector in the class for which you have added the observer.
In the selector , do the necessary things that you want to do .
So in your application main controller class , add this observer and
implement the selector and do the necessary things in the selector.
On 27-Oct-06, at 3:03 PM, Amit Jain wrote:
> 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 <email@hidden> 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 <email@hidden> wrote:
>>
>>
>> thanks i ll try for this and update you soon.
>> Regards..
>> Amit Jain
>>
>> On 10/26/06, Sherm Pendley <email@hidden > 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 (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> 40effigent.net
>>
>> 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