---
title: "setDelegate(_:)"
framework: Exception Handling
role: symbol
role_heading: Instance Method
platforms: [Mac Catalyst 13.0+, macOS 10.0+]
path: "exceptionhandling/nsexceptionhandler/setdelegate(_:)"
---

# setDelegate(_:)

Sets the delegate of the NSExceptionHandler object.

## Declaration

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

## Parameters

- `anObject`: The object to receive the delegation messages described in doc://com.apple.documentation/documentation/ExceptionHandling/nsexceptionhandlerdelegate

## See Also

### Getting and setting the delegate

- [delegate()](exceptionhandling/nsexceptionhandler/delegate().md)
