Deprecated NSWorkspace Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in OS X v10.6

checkForRemovableMedia

Polls the system’s drives for any disks that have been inserted but not yet mounted. (Deprecated in OS X v10.6. Do not use.)

- (void)checkForRemovableMedia
Discussion

This method doesn’t wait until such disks are mounted; instead, it requests that the disk be mounted asynchronously and returns immediately. Currently has no effect.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

fileSystemChanged

Returns a Boolean value indicating whether a change to the file system has been registered with a noteFileSystemChanged message since the last fileSystemChanged message. (Deprecated in OS X v10.6. Use the FSEvents API described in FSEvents Reference instead.)

- (BOOL)fileSystemChanged
Return Value

Currently, this method always returns NO.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

findApplications

Examines all apps and updates the records of registered services and file types. (Deprecated in OS X v10.6. Do not use.)

- (void)findApplications
Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

mountNewRemovableMedia

Returns the full pathnames of any newly mounted disks. (Deprecated in OS X v10.6. Do not use.)

- (NSArray *)mountNewRemovableMedia
Return Value

An array of NSString objects, each of which contains the full pathname to a newly mounted disk.

Discussion

This method polls the system’s drives for any disks that have been inserted but not yet mounted and waits until the new disks have been mounted. This method posts an NSWorkspaceDidMountNotification to the NSWorkspace object’s notification center when it is finished. Currently provides the same functionality as mountedRemovableMedia.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

noteFileSystemChanged

Informs the NSWorkspace object that the file system has changed. (Deprecated in OS X v10.6. Use the FSEvents API described in FSEvents Reference instead.)

- (void)noteFileSystemChanged
Discussion

The NSWorkspace object then gets the status of all the files and directories it is interested in and updates itself appropriately. This method is used by many objects that write or delete files.

The NSDocument and NSSavePanel objects use this method when saving a file. If you create a file directly, you should call noteFileSystemChanged so that the Finder can update the folder if it is open.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

noteUserDefaultsChanged

Informs the NSWorkspace object that the defaults database has changed. (Deprecated in OS X v10.6. Register for the NSUserDefaultsDidChangeNotification notification instead.)

- (void)noteUserDefaultsChanged
Discussion

The NSWorkspace object then reads all the defaults it is interested in and reconfigures itself appropriately. For example, this method is used by the Preferences app to notify the Finder whether the user prefers to see hidden files. Currently has no effect.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

openTempFile:

Opens the specified temporary file using the default app for its type. (Deprecated in OS X v10.6. Use the openFile: method instead.)

- (BOOL)openTempFile:(NSString *)fullPath
Parameters
fullPath

The full path to the temporary file.

Return Value

YES if the file was successfully opened; otherwise, NO.

Discussion

The sending app is deactivated before the request is sent. Using this method instead of one of the openFile:... methods lets the receiving app know that it should delete the file when it no longer needs it. Currently provides the same functionality as openFile:.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

slideImage:from:to:

Animates a sliding image from one point to another. (Deprecated in OS X v10.6. Do not use.)

- (void)slideImage:(NSImage *)image from:(NSPoint)fromPoint to:(NSPoint)toPoint
Parameters
image

The image to animate.

fromPoint

The starting point, in screen coordinates.

toPoint

The ending point, in screen coordinates.

Discussion

Currently unimplemented.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

userDefaultsChanged

Returns a Boolean value indicating whether a change to the defaults database has been registered with a noteUserDefaultsChanged message since the last userDefaultsChanged message. (Deprecated in OS X v10.6. Register for the NSUserDefaultsDidChangeNotification notification instead.)

- (BOOL)userDefaultsChanged
Return Value

Currently, this method always returns NO.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.6.
Declared In
NSWorkspace.h

Deprecated in OS X v10.7

activeApplication

Returns a dictionary with information about the current active app. (Deprecated in OS X v10.7. Use the frontmostApplication or menuBarOwningApplication method instead.)

- (NSDictionary *)activeApplication
Return Value

A dictionary with information about the app. The dictionary contains as many of the keys described in Table 1 as are available.

Availability
  • Available in OS X v10.2 and later.
  • Deprecated in OS X v10.7.
Related Sample Code
Declared In
NSWorkspace.h

launchedApplications

Returns an array of dictionaries, one entry for each running app. (Deprecated in OS X v10.7. Use the runningApplications method instead.)

- (NSArray *)launchedApplications
Return Value

An array of NSDictionary objects. Each dictionary contains as many of the keys described in Table 1 as are available.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.7.
Declared In
NSWorkspace.h

mountedLocalVolumePaths

Returns the mount points of all local volumes, not just the removable ones returned by mountedRemovableMedia. (Deprecated in OS X v10.7. Do not use.)

- (NSArray *)mountedLocalVolumePaths
Return Value

An array of NSString objects, each of which contains the full pathname of the mount point for any local volumes.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.7.
Declared In
NSWorkspace.h

mountedRemovableMedia

Returns the full pathnames of all currently mounted removable disks. (Deprecated in OS X v10.7. Do not use.)

- (NSArray *)mountedRemovableMedia
Return Value

An array of NSString objects, each of which contains the full pathname of a mounted removable disk.

Discussion

If the computer provides an interrupt or other notification when the user inserts a disk into a drive, the Finder will mount the disk immediately. However, if no notification is given, the Finder won’t be aware that a disk needs to be mounted. On such systems, an app should invoke either mountNewRemovableMedia or checkForRemovableMedia before invoking mountedRemovableMedia. Either of these methods cause the Finder to poll the drives to see if a disk is present. If a disk has been inserted but not yet mounted, these methods will cause the Finder to mount it.

The Disk button in an Open or Save panel invokes mountedRemovableMedia and mountNewRemovableMedia as part of its operation, so most apps won’t need to invoke these methods directly.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.7.
Related Sample Code
Declared In
NSWorkspace.h