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

# updateWindows()

Sends an [`update()`](/documentation/AppKit/NSWindow/update()) message to each onscreen window.

```
func updateWindows()
```

## Discussion

This method is invoked automatically in the main event loop after each event when running in `NSDefaultRunLoopMode` or `NSModalRunLoopMode`. This method is not invoked automatically when running in `NSEventTrackingRunLoopMode`.

When this method begins, it posts an [`willUpdateNotification`](/documentation/AppKit/NSApplication/willUpdateNotification) to the default notification center. When it successfully completes, it posts an [`didUpdateNotification`](/documentation/AppKit/NSApplication/didUpdateNotification).

## See Also

[`func applicationDidUpdate(Notification)`](/documentation/AppKit/NSApplicationDelegate/applicationDidUpdate(_:))

Tells the delegate that the app’s windows did update.

[`func applicationWillUpdate(Notification)`](/documentation/AppKit/NSApplicationDelegate/applicationWillUpdate(_:))

Tells the delegate that the app is about to update its windows.

[`func update()`](/documentation/AppKit/NSWindow/update())

Updates the window.



---

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)