This is taken from NSHipster, see link
Foundation defines two pairs of assertion macros:
NSAssert/NSCAssert
NSParameterAssert/NSCParameterAssert
Foundation makes two distinctions in their assertion handler APIs that
are both semantic and functional.
The first distinction is between a general assertion (NSAssert
) and a parameter assertion (NSParameterAssert
). As a rule of thumb,
methods / functions should use NSParameterAssert/NSCParameterAssert
statements at the top of methods to enforce any preconditions about
the input values; in all other cases, use NSAssert/NSCAssert
.
The second is the difference between C and Objective-C assertions: NSAssert
should only be used in an Objective-C context
(i.e. method implementations), whereas NSCAssert should only be used
in a C context (i.e. functions).