<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/newItem(forRepresentedObject:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionView(im)newItemForRepresentedObject:"
  },
  "title" : "newItem(forRepresentedObject:)"
}
-->

# newItem(forRepresentedObject:)

Returns the collection view item that is used for the specified object.

```
func newItem(forRepresentedObject object: Any) -> NSCollectionViewItem
```

## Parameters

`object`

The content object that the collection view item will represent.

## Return Value

An initialized collection view item with the specified object and the appropriate view set. The collection view item should not be autoreleased.

## Discussion

Whenever possible, register classes or nib files for your items instead of using this property. For more information, see Creating Collection View Items.

Subclasses can override this method if the collection view items are not generated from a prototype or if the prototype view needs to be modified. The subclass is responsible for setting the `view`  and representedObject of the new collection view 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)