• 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
removeObserver problem with Panther in java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

removeObserver problem with Panther in java


  • Subject: removeObserver problem with Panther in java
  • From: Marc Pergand <email@hidden>
  • Date: Wed, 31 Dec 2003 14:05:02 -0800

Hi all,

In some part of my application, I need to be informed if a new CD has been mounted so I register to "NSWorkspaceDidMountNotification like this:

NSSelector mountSelector=new NSSelector("mountedNotification", new Class[]{NSNotification.class} );
NSNotificationCenter notCenter;
notCenter = NSWorkspace.sharedWorkspace().notificationCenter();
notCenter.addObserver(this, mountSelector,"NSWorkspaceDidMountNotification", null);

and when I don't longer need it:

NSNotificationCenter notCenter = NSWorkspace.sharedWorkspace().notificationCenter(); notCenter.removeObserver(this);

Everything works great until Panther: removeObserver seems to do nothing and the next time I register, I receive two notifications for the same new mounted CD, and the next time three, then four, ... !

Did I missing something?

Any help would be appreciate, thanks in advance.

Marc.
_______________________________________________
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.

  • Prev by Date: Re: Screensaver on Jaguar
  • Next by Date: changing a Documenttype in NSDocument
  • Previous by thread: Re: checkbox suddenly won't change state
  • Next by thread: changing a Documenttype in NSDocument
  • Index(es):
    • Date
    • Thread