This is Notifier.m in view mode; [Download] [Up]
/* File Notifier.m A notifier alerts other objects when its status either changes or will change. An object typically responds to the notification message by updating information that depends on the notifying object. Objects that register for notification must respond to the update:message: method. The first argument to this method is the object sending the notification. The second is an integer that identifies the message. */ #import <appkit/appkit.h> #import "Notifier.h" /* 行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行行 */ @implementation Notifier - init { [super init]; receivers = [[List alloc] init]; return self; } - free { [receivers free]; [super free]; return self; } - signup: (id) object { [receivers addObject: object]; return self; } - unsignup: (id) object { [receivers removeObject: object]; return self; } - notify: (int) message { [receivers makeObjectsPerform: @selector(update:message:) with: (id) message]; return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.