<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ExceptionHandling",
  "identifier" : "/documentation/ExceptionHandling/NSExceptionHandler/setDelegate(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Exception Handling"
    ],
    "preciseIdentifier" : "c:objc(cs)NSExceptionHandler(im)setDelegate:"
  },
  "title" : "setDelegate(_:)"
}
-->

# setDelegate(_:)

Sets the delegate of the `NSExceptionHandler` object.

```
func setDelegate(_ anObject: Any!)
```

## Parameters

`anObject`

The object to receive the delegation messages described in <doc://com.apple.documentation/documentation/ExceptionHandling/nsexceptionhandlerdelegate>

---

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)