Skip to content

Instantly share code, notes, and snippets.

@tpitale
Created October 26, 2010 04:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpitale/646305 to your computer and use it in GitHub Desktop.
Save tpitale/646305 to your computer and use it in GitHub Desktop.
Quick NSDistributedNotificationCenter Example in MacRuby
framework 'Cocoa'
framework 'Foundation'
class NotificationHandler
def handle(notification)
puts notification.name
puts notification.object.inspect
puts notification.userInfo.inspect
end
end
center = NSDistributedNotificationCenter.defaultCenter
center.addObserver(NotificationHandler.new, selector:'handle:', name:nil, object:nil)
NSApplication.sharedApplication
NSApp.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment