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

# removeWindowController(_:)

Removes the specified window controller from the receiver’s array of window controllers.

```
func removeWindowController(_ windowController: NSWindowController)
```

## Parameters

`windowController`

The window controller that is removed.

## Discussion

A document with no window controllers is not necessarily closed. However, a window controller can be set to close its associated document when the window is closed or the window controller is deallocated.

The default implementation of this method sends a [`document`](/documentation/AppKit/NSWindowController/document) message to the passed-in window controller with a `nil` argument. You would not typically override this method.

## See Also

[`shouldCloseDocument`](/documentation/AppKit/NSWindowController/shouldCloseDocument)

A Boolean value that indicates whether the receiver necessarily closes the associated document when the window it manages is closed.



---

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)