Platforms to show: All Mac Windows Linux Cross-Platform

NSFileVersionMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class iCloud MBS MacCloud Plugin 11.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The class for different file versions on Mac OS X 10.7.

Instances of NSFileVersionMBS for the same version of the same file are equal, and instances of NSFileVersionMBS for different versions of the same file are not equal, but the equality of NSFileVersionMBSs for different files is undefined. Repeated invocations of the methods that return NSFileVersionMBSs do not necessarily return the exact same instance of NSFileVersionMBS.

An NSFileVersion object represents a snapshot of a file at a specific point in time. You use the NSFileVersion class to access and create and manage file revisions in your application. Each instance of this class contains meta information about a single revision, such as the location of the file containing the revision data, the modification date of the revision, and whether the revision is discardable.

In Mac OS X applications, you can use file version objects to track changes to a local file over time and to prevent the loss of data during editing. When managing local versions, the document architecture creates versions at specific points in the lifetime of your application. Your application can also create versions explicitly at times that your application designates as appropriate.

In addition to managing local files, the system also uses this class to manage cloud-based files. For files in the cloud, there is usually only one version of the file at any given time. However, additional file versions may be created in cases where two different computers attempt to save the file to the cloud at the same time. In that case, one file is chosen as the current version and any other versions are tagged as being in conflict with the original. Conflict versions are reported to the appropriate file presenter objects and should be resolved as soon as possible so that the corresponding files can be removed from the cloud.

Available on Mac OS X 10.7 or later.
Please also check the documentation from Apple for the NSFileVersion class.

Works also well with files in backup (Time Machine) to find older versions.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.

Constants

Constant Value Description
NSFileVersionAddingByMoving 1 One of the constants for addVersionOfItemAtURL. Whether addVersionOfItemAtURL can move the new version contents file into the version store instead of copying it. Moving is much faster. See the comment for temporaryDirectoryURLForNewVersionOfItemAtURL for an example of when this useful.
NSFileVersionReplacingByMoving 1 One of the constants for replaceItemAtURL. Whether replaceItemAtURL must move the version's contents out of the version store instead of copying it. This is useful when you want to promote a version's contents to a separate file. You wouldn't use this to restore a version of a file.

This class has no sub classes.

Some events using this class:

Blog Entries


The items on this page are in the following plugins: MBS MacCloud Plugin.


NSFilePresenterMBS   -   NSFileWrapperMBS


The biggest plugin in space...