Macro

NSCAssert1

Generates an assertion if a given condition is false.

Declaration

#define NSCAssert1(condition, desc, arg1)

Discussion

Assertions evaluate a condition and, if the condition evaluates to false, call the assertion handler for the current thread, passing it a format string and a variable number of arguments. Each thread has its own assertion handler, which is an object of class NSAssertionHandler. When invoked, an assertion handler prints an error message that includes method and class names (or the function name). It then raises an NSInternalInconsistencyException exception.

The NSCAssert1 macro evaluates the condition and serves as a front end to the assertion handler. This macro should be used only within C functions.

The condition expression must evaluate to true or false. description is a printf-style format string that describes the failure condition. arg1 is an argument to be inserted, in place, into the description.

Assertions are disabled if the preprocessor macro NS_BLOCK_ASSERTIONS is defined. All assertion macros return void.

See Also

Assertions

NSAssertionHandler

An object that logs an assertion to the console.

NSAssert

Generates an assertion if a given condition is false.

NSAssert1

Generates an assertion if a given condition is false.

NSAssert2

Generates an assertion if a given condition is false.

NSAssert3

Generates an assertion if a given condition is false.

NSAssert4

Generates an assertion if a given condition is false.

NSAssert5

Generates an assertion if a given condition is false.

NSCAssert

Generates an assertion if the given condition is false.

NSCAssert2

Generates an assertion if a given condition is false.

NSCAssert3

Generates an assertion if a given condition is false.

NSCAssert4

Generates an assertion if a given condition is false.

NSCAssert5

Generates an assertion if a given condition is false.

NSCParameterAssert

Evaluates the specified parameter.

NSParameterAssert

Validates the specified parameter.