Re: NSWorkspace's notificationCenter
Re: NSWorkspace's notificationCenter
- Subject: Re: NSWorkspace's notificationCenter
- From: j o a r <email@hidden>
- Date: Mon, 14 Mar 2005 09:45:29 +0100
On 2005-03-14, at 06.59, Joannou Ng wrote:
Remove does the following:
- (IBAction)remove:(id)sender {
[[[NSWorkspace sharedWorkspace] notificationCenter]
removeObserver:self name:@"NSWorkspaceDidMountNotification"
object:[NSWorkspace sharedWorkspace]];
}
I would be really surprised if it were intended that you should type
@"NSWorkspaceDidMountNotification", I think it should be
NSWorkspaceDidMountNotification (ie. not type as a constant string, but
rather using the defined name).
In many cases I expect the strings to be the same, but in some cases in
Cocoa they clearly are not. Not that I expect it to solve this
particular problem - but it is probably a good thing to learn / keep in
mind.
Like Dan said, I also think it's good practice to unsubscribe from all
objects, and not just one particular object. Most of the time that's
what you want anyway.
That said, if you can't get it to work like you expect, create a
reproducible case and attach it to a bug report.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden