Rightpoint / RZAssert

Useful assertion macros from the fine folks at Raizlabs.
Other
7 stars 0 forks source link

Assertion/safety check hybrids #27

Open ZevEisenberg opened 9 years ago

ZevEisenberg commented 9 years ago

I have this all over my code:

RZASSERT_KINDOF(foo, NSArray);
if ( [foo isKindOfClass:[NSArray class]] ) {

This pattern is so common that it would be useful to add macros for it. Something like:

RZASSERT_SAFETY_CHECK_KINDOF(foo, NSArray) {
ZevEisenberg commented 9 years ago

Or perhaps there’s a way to do it like this, which is more readable to someone who isn't familiar with RZAssert:

if ( RZASSERT_SAFETY_CHECK_KINDOF(foo, NSArray) ) {