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

# setObjectValue(_:)

Sets the receiver’s object value.

```
func setObjectValue(_ obj: (any NSCopying)?)
```

## Parameters

`obj`

The new object value for the cell.

## Discussion

If `setObjectValue:` is called with an `NSURL` object, [`clickedPathComponentCell`](/documentation/AppKit/NSPathCell/clickedPathComponentCell) is automatically called. The [`objectValue`](/documentation/AppKit/NSCell/objectValue) method returns the most recently set URL value. The `setObjectValue:` method can also take a string value, with the items separated by the path separator (`/`). Any other value is a programming error and will cause an assertion.

---

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)