Listen to notifications

40 views
Skip to first unread message

Emmanuel Pire

unread,
Mar 3, 2016, 12:24:08 PM3/3/16
to NodObjC
Hi everyone,

I'm new to ObjC and I'm trying to listen to a notification.
Basically i need to do this: 

[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(receiveWakeNotification:) name:NSWorkspaceDidWakeNotification object:NULL];

But I can't figure out how to write it with NodObjC. I have the workspace and notificationCenter, but how to listen to it ?

$.framework('Cocoa');
var ws = $.NSWorkspace('sharedWorkspace');
var notifCenter = ws('notificationCenter');

Any help is appreciated.

Thanks !

-- Emmanuel
Reply all
Reply to author
Forward
0 new messages