Quantcast
Channel: programming
Viewing all articles
Browse latest Browse all 25

NSAsserts

$
0
0

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(). 


Viewing all articles
Browse latest Browse all 25

Trending Articles