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

# addSelectionIndexPaths(_:)

Adds the objects at the specified `indexPaths` in the tree controller’s content to the current selection.

```
func addSelectionIndexPaths(_ indexPaths: [IndexPath]) -> Bool
```

## Discussion

Attempting to change the selection may cause a `commitEditing` message which fails, thus denying the selection change.

---

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)