removeObserver problem with Panther in java
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.