NSWorkspace notification problems
NSWorkspace notification problems
- Subject: NSWorkspace notification problems
- From: Grahame Jastrebski <email@hidden>
- Date: Mon, 21 Jan 2002 11:12:37 -0800
Hello,
I am working on an application that needs to receive notification when
the contents of a folder changes. I am attempting to do this by
receiving notification from my app's shared NSWorkspace.
Below is a code snippet from my app that connects to my app's shared
NSWorkspace notification center. I can receive notifications including:
NSWorkspaceDidLaunchApplicationNotification
NSWorkspaceDidMountNotification
NSWorkspaceDidTerminateApplicationNotification
NSWorkspaceDidUnmountNotification
NSWorkspaceWillLaunchApplicationNotification
NSWorkspaceWillPowerOffNotification
NSWorkspaceWillUnmountNotification
However, the notification NSWorkspaceDidPerformFileOperationNotification
does not seem to work! Does anyone have any ideas, either how to get
this notification to work, or how to implement the same functionality
another way? Shouldn't moving a file or renaming a file or directory
cause the NSWorkspaceDidPerformFileOperationNotification notification to
be posted?
Thanks in advance for any help, it is greatly appreciated!
Grahame
- (id)init {
// other code...
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
selector:@selector(fileOperationNotification:)
name:NSWorkspaceDidPerformFileOperationNotification
object:nil];
// other code...
}
- (void)dealloc {
// other code...
[[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:
self];
// other code...
}
- (void)fileOperationNotification:(NSNotification *)aNotification {
NSLog(@"Work space did perform file operation.");
}