• 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
NSWorkspace notification problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.");
}


  • Follow-Ups:
    • Re: NSWorkspace notification problems
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Re(2): making NSProgressIndicator hidden
  • Next by Date: Re: Processes
  • Previous by thread: Re: NSSplitView size, how to change ?!
  • Next by thread: Re: NSWorkspace notification problems
  • Index(es):
    • Date
    • Thread