Instance Method

persistentIdentifierForItemAtURL:

Returns a unique identifier for the given URL.

Declaration

- (NSFileProviderItemIdentifier)persistentIdentifierForItemAtURL:(NSURL *)url;

Parameters

url

The URL of a shared document.

Return Value

A unique identifier for the item specified by the URL, or nil if the document is not in the File Provider's shared container.

Discussion

Override this method to define a static mapping between URLs and their persistent identifiers. A document's identifier should remain constant over time; it should not change when the document is edited, moved, or renamed.

For example, if you already have a unique key for the document in your cloud database, you can use that key as the document’s identifier.

Always return nil if the URL is not inside in the directory referred to by the NSFileProviderManager object's documentStorageURL property.

See Also

Working with Items and Persistent Identifiers

- URLForItemWithPersistentIdentifier:

Returns the URL for a given persistent identifier.

Deprecated
- itemForIdentifier:error:

Returns a description of the item associated with the persistent identifier.

- enumeratorForContainerItemIdentifier:error:

Returns an enumerator for the specified item.

NSFileProviderItemIdentifier

A unique identifier for an item managed by the File Provider extension.