<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderExtension/item(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "File Provider"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileProviderExtension(im)itemForIdentifier:error:"
  },
  "title" : "item(for:)"
}
-->

# item(for:)

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

```
func item(for identifier: NSFileProviderItemIdentifier) throws -> NSFileProviderItem
```

## Parameters

`identifier`

The persistent identifier for a shared document.

## Return Value

A custom object that describes the specified document or directory, or `nil` in Objective-C if an error occurs.

## Discussion

Your File Provider extension must define a class that adopts the [`NSFileProviderItemProtocol`](/documentation/FileProvider/NSFileProviderItemProtocol) interface. Instances of this class provides access to information about an item (a document or directory) that your File Provider manages and stores.

Your class should implement as many of the protocol’s optional methods as makes sense for the specified item. This lets the system provide as much information as possible to the user as they browse your File Provider.

Optionally, you can define different classes for different types of items—for example, different classes for documents and directories. These classes can define different subsets of the [`NSFileProviderItemProtocol`](/documentation/FileProvider/NSFileProviderItemProtocol) interface’s optional methods. For example, the class representing a folder implements the [`childItemCount`](/documentation/FileProvider/NSFileProviderItemProtocol/childItemCount) property, while the class representing a document does not.

Override this method to look up the item associated with the persistent identifier and return an instance of your custom [`NSFileProviderItemProtocol`](/documentation/FileProvider/NSFileProviderItemProtocol) class for that item.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)