• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa/Java - NSNotification not received.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Cocoa/Java - NSNotification not received.
      • From: Rams <email@hidden>
References: 
 >Cocoa/Java - NSNotification not received. (From: Rams <email@hidden>)

  • Prev by Date: Re: NSFileManager fileAttributesAtPath confusion
  • Next by Date: Re: Can I require 10.2?
  • Previous by thread: Cocoa/Java - NSNotification not received.
  • Next by thread: Re: Cocoa/Java - NSNotification not received.
  • Index(es):
    • Date
    • Thread