I have a couple of time been caught out putting function code in NSAssert or NSParameter assert, like
NSParameterAssert( [self doSomeWork] );
The problem with this is when you do a release build not only does the code that does an abort if the test fails get omitted from the code, but my code within the () is also omitted also.
Obviously this fix is simple but to me it still this seems wrong, the logic of the code is changed between test build and release build.
I should make it clear I only use this pattern for situation where if the assert fail it is a programmer error.
Personally, I prefer the AssertMacros, which guarantee that the code will be executed, but don’t use assertions.
http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/EXTERNAL_HEADERS/AssertMacros.h