What is the difference between NSAssert
and NSCAssert
? When I explored their implementation they looked very similar and I couldn't find an answer to my question.
I guess that it will also explain the difference between NSParameterAssert
and NSCParameterAssert
.
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).
More at http://nshipster.com/nsassertionhandler/
Note that using NSAssert/NSParameterAssert within a block may cause a retain cycle. Use the C variants instead. Google NSAssert retain cycle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With