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

# register(_:forItemIdentifier:)

Registers a nib file for the scrubber to use when it creates new items in the scrubber.

```
func register(_ nib: NSNib?, forItemIdentifier itemIdentifier: NSUserInterfaceItemIdentifier)
```

## Parameters

`nib`

The nib object containing the item object. The nib file must contain exactly one top-level [`NSScrubberItemView`](/documentation/AppKit/NSScrubberItemView) object. You can use a custom subclass when configuring the object in the nib file. Specify `nil` to unregister a previously registered file.

`itemIdentifier`

The string that identifies the type of items. You use this string later when requesting new items. The string must be unique among the other registered item view classes of this scrubber. This parameter must not be an empty string or `nil`.

---

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)