NSAsserts
>> terça-feira, 10 de junho de 2008 –
xcode
NSAssert(theDate == nil, @"Argument must be non-nil");
To deploy without NSAsserts:
In the Debug version, you will want all your asserts checked. In
the Release configuration, you will not. I will typically block assertion checking in the Release configuration.
To do this, bring up the build info by double-clicking the lottery target. Go to the Build tab and select the
Release configuration. Under GCC Preprocessing, add NS_BLOCK_ASSERTIONS to the Preprocessor
NSAssert() works only inside Objective-C methods. If you need to check an assertion in a C function, use
NSCAssert().