Io Reference







Core   /   NotificationCenter   /   NotificationCenter





An NotificationCenter similar to the one found in Apple's FoundationKit.

Example use:

// in listener
listener := NotificationListener clone setTarget(self) setName("FeedDownloadedFile") start

// in sender
Notification clone setSender(self) setName("FeedDownloadedFile") post

// note: notifications can also be reused, and any extra data can be added in it's slots

// to stop listening
listener stop
 
 
 



addListener(aNotificationListener)

Removes aNotificationListener from listeners list. Returns self.
listeners

Returns list of NotificationListeners.
postNotification(aNotification)

Sends aNotification to be handled by listeners. Returns self. Implementation:
listeners foreach(handleNotification(n))