<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSException/raise(_:format:arguments:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSException(cm)raise:format:arguments:"
  },
  "title" : "raise(_:format:arguments:)"
}
-->

# raise(_:format:arguments:)

Creates and raises an exception with the specified name, reason, and arguments.

```
class func raise(_ name: NSExceptionName, format: String, arguments argList: CVaListPointer)
```

## Parameters

`name`

The name of the exception.

`format`

A human-readable message string (that is, the exception reason) with conversion specifications for the variable arguments in `argList`.

`argList`

Variable information to be inserted into the formatted exception reason (in the manner of `vprintf`).

## Discussion

The user-defined dictionary of the generated object is `nil`.

## See Also

[`+  raise:format:`](/documentation/Foundation/NSException/raise:format:)

A convenience method that creates and raises an exception.



---

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)