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

# register(_:forIdentifier:)

Registers a NIB for the specified identifier, so that view-based table views can use it to instantiate views.

```
func register(_ nib: NSNib?, forIdentifier identifier: NSUserInterfaceItemIdentifier)
```

## Parameters

`nib`

The nib containing the view.

`identifier`

The identifier of the view to create.

## Discussion

Use this method to associate one of the NIB’s cell views with `identifier` so that the table can instantiate this view when requested. This method is used when [`makeView(withIdentifier:owner:)`](/documentation/AppKit/NSTableView/makeView(withIdentifier:owner:)) is called, and there was no NIB created at design time for the specified identifier. This allows dynamic loading of NIBs that can be associated with the table.

Because a NIB can contain multiple views, you can associate the same NIB with multiple identifiers. To remove a previously associated NIB for `identifier`, pass in `nil` for the `nib` value.

> Note:
> This method applies only to ``doc://com.apple.appkit/documentation/AppKit/NSView``-based table views.

---

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)