---
title: loadWindow()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nswindowcontroller/loadwindow()
---

# loadWindow()

Loads the receiver’s window from the nib file.

## Declaration

```swift
func loadWindow()
```

## Discussion

Discussion You should never directly invoke this method. Instead, access the window property so the windowDidLoad() and windowWillLoad() methods are invoked. Subclasses can override this method if the way it finds and loads the window is not adequate. It uses the Bundle class’s 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.

## See Also

### Loading and Displaying the Window

- [showWindow(_:)](appkit/nswindowcontroller/showwindow(_:).md)
- [isWindowLoaded](appkit/nswindowcontroller/iswindowloaded.md)
- [window](appkit/nswindowcontroller/window.md)
- [windowDidLoad()](appkit/nswindowcontroller/windowdidload().md)
- [windowWillLoad()](appkit/nswindowcontroller/windowwillload().md)
