<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/parent",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(py)parentWindow"
  },
  "title" : "parent"
}
-->

# parent

The parent window to which the window is attached as a child.

```
weak var parent: NSWindow? { get set }
```

## Discussion

This property should be set from a subclass when it is overridden by a subclass’s implementation. It should not be set otherwise.

Note that calling [`orderOut(_:)`](/documentation/AppKit/NSWindow/orderOut(_:)) on a child window causes the window to be removed from its parent window before it is itself removed.

---

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)