NSDistributedNotificationCenter
NSDistributedNotificationCenter
- Subject: NSDistributedNotificationCenter
- From: April Gendill <email@hidden>
- Date: Tue, 16 Dec 2003 20:35:25 -0700
-(void)awakeFromNib{
[mainWindow makeKeyAndOrderFront:self];
[[NSDistributedNotificationCenter defaultCenter]
addObserver:[NSWorkspace sharedWorkspace]
selector:@selector([self addItemToTable:]) name:nil object:nil
suspensionBehavior:nil];
}
Above is the awake from nib I'm using. It adds a pretty wide
observer.... The problem is, once a notification is received (and it
seems to try to work) it attempts to have NSWorkspace perform the
addItemToTable method. The addItemToTable is mine however and thusly in
the main controller.
The way it is typed @selector([self addItemToTable:]) produces a parse
error: MainController.m:34: error: parse error before '[' token
. So how can I get the notification in the workspace to trigger a
method in my class?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.