Type Method


Returns all versions of the specified file except the current version.


+ (NSArray<NSFileVersion *> *)otherVersionsOfItemAtURL:(NSURL *)url;



The URL of the file whose versions you want.

Return Value

An array of file version objects or nil if there is no such file. The array does not contain the version object returned by the currentVersionOfItemAtURL: method.


For locally based files, this property typically contains versions of the file that you saved explicitly or that were saved at appropriate times while the file was being edited. For documents residing in the cloud, this property typically returns zero or more file versions representing conflicting versions of a file that need to be resolved with the current version.

See Also

Getting the Version of a File

+ currentVersionOfItemAtURL:

Returns the most recent version object for the file at the specified URL.

+ versionOfItemAtURL:forPersistentIdentifier:

Returns the version of the file that has the specified persistent ID.

+ temporaryDirectoryURLForNewVersionOfItemAtURL:

Creates and returns a temporary directory to use for saving the contents of the file.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software