<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTAssertNoThrowSpecific",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:@macro@XCTAssertNoThrowSpecific"
  },
  "title" : "XCTAssertNoThrowSpecific"
}
-->

# XCTAssertNoThrowSpecific

Asserts that an expression doesn’t throw a specific `NSException`.

```
#define XCTAssertNoThrowSpecific(expression, exception_class, ...)
```

## Parameters

`expression`

An expression.

`exception_class`

The class of the exception.

`…`

An optional description of the failure. A literal <doc://com.apple.documentation/documentation/Foundation/NSString>, optionally with string format specifiers.

## Discussion

This function generates a failure if `expression` throws an <doc://com.apple.documentation/documentation/Foundation/NSException> of class `exception_class`.

---

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)