<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSBrowserDelegate/rootItem(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSBrowserDelegate(im)rootItemForBrowser:"
  },
  "title" : "rootItem(for:)"
}
-->

# rootItem(for:)

Asks the delegate to return the root item of the browser.

```
@MainActor optional func rootItem(for browser: NSBrowser) -> Any?
```

## Parameters

`browser`

The browser.

## Return Value

The browser’s root item.

## Discussion

By default, `nil` identifies the root item. This method can specify a different root item. To reload the previously set root item, call [`loadColumnZero()`](/documentation/AppKit/NSBrowser/loadColumnZero()), and [`rootItem(for:)`](/documentation/AppKit/NSBrowserDelegate/rootItem(for:)) will be called again.

---

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)