Macro

NSCParameterAssert

Evaluates the specified parameter.

Declaration

#define NSCParameterAssert(condition)

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.

This macro validates a parameter for a C function. Simply provide the parameter as the condition argument. The macro evaluates the parameter and, if the parameter evaluates to false, logs an error message that includes the parameter and then raises an exception.

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.

NSCAssert1

Generates an assertion if a 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.

NSParameterAssert

Validates the specified parameter.