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

# loadWindow()

Loads the receiver’s window from the nib file.

```
func loadWindow()
```

## Discussion

You should never directly invoke this method. Instead, access the [`window`](/documentation/AppKit/NSWindowController/window) property so the [`windowDidLoad()`](/documentation/AppKit/NSWindowController/windowDidLoad()) and [`windowWillLoad()`](/documentation/AppKit/NSWindowController/windowWillLoad()) methods are invoked. Subclasses can override this method if the way it finds and loads the window is not adequate. It uses the <doc://com.apple.documentation/documentation/Foundation/Bundle> class’s <doc://com.apple.documentation/documentation/Foundation/Bundle/init(for:)> method to get the bundle, using the class of the nib file owner as argument. It then locates the nib file within the bundle and, if successful, loads it; if unsuccessful, it tries to find the nib file in the main bundle.

---

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)