Re: Cocoa/Java - NSNotification not received.
Re: Cocoa/Java - NSNotification not received.
- Subject: Re: Cocoa/Java - NSNotification not received.
- From: email@hidden
- Date: Fri, 07 Mar 2003 09:12:30 -0800
Rams wrote:
|I am trying to receive notifications from a window without setting my
|object as the window's delegate. My code looks something like this...
|
| ...
|
| public void awakeFromNib() {
|
| // Waking code ending with...
| NSNotificationCenter.defaultCenter().addObserver(this,
| didMiniSelector,
| "WindowDidMiniaturizeNotification",
| null);
| }
|
| ...
|
|The problem is, I get no notifications. Does anyone have any insight?
I'd guess that you've got the name of the notification wrong. In vanilla Cocoa, notification names *always* start with "NS". While the documentation for the Cocoa-Java NSWindow class documents a WindowDidMiniaturizeNotification, it is documented as a *symbol*, not as a string literal. Where did you find documentation of the name as a string literal?
|I'm looking at
|
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/
|ProgrammingTopics/Notifications/Tasks/Threading.html and wondering if
|this is my problem.
Getting the notification name wrong seems a more likely explanation.
Glen Fisher
_______________________________________________
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.