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

# makeWindowControllers()

Creates the window controller objects that the document uses to display its content.

```
func makeWindowControllers()
```

## Discussion

Subclasses may override this method to create the initial window controller(s) for the document.

The base class implementation creates an `NSWindowController` object with [`windowNibName`](/documentation/AppKit/NSDocument/windowNibName) and with the document as the file’s owner if [`windowNibName`](/documentation/AppKit/NSDocument/windowNibName) returns a name. If you override this method to create your own window controllers, be sure to use [`addWindowController(_:)`](/documentation/AppKit/NSDocument/addWindowController(_:)) to add them to the document after creating them.

This method is called by the `NSDocumentController` `open...` methods, but you might want to call it directly in some circumstances.

---

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)