<!--
{
  "documentType" : "article",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/alert-panel-return-values",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Alert Panel Return Values"
}
-->

# Alert Panel Return Values

These constants define values returned by the [`NSRunAlertPanel`](/documentation/AppKit/NSRunAlertPanel) function and by the `NSApplication` method [`runModalSession(_:)`](/documentation/AppKit/NSApplication/runModalSession(_:)) when the modal session is run with an `NSPanel` provided by the [`NSGetAlertPanel`](/documentation/AppKit/NSGetAlertPanel) function.

## Topics

### Constants

[`var NSAlertDefaultReturn: Int`](/documentation/AppKit/NSAlertDefaultReturn)

The user pressed the default button.

[`var NSAlertAlternateReturn: Int`](/documentation/AppKit/NSAlertAlternateReturn)

The user pressed the alternate button.

[`var NSAlertOtherReturn: Int`](/documentation/AppKit/NSAlertOtherReturn)

The user pressed a second alternate button.

[`var NSAlertErrorReturn: Int`](/documentation/AppKit/NSAlertErrorReturn)

The alert cannot identify the reason it was closed; it may have been closed by an external source or by a button other than those listed above.



---

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)