2010-05-02 17 views

回答

7

NSCAssert()(也NSCAssert1() ...高達NSCAssert5()

4
void assert(int expression); 

If expression evaluates to 0 (false), then the expression, source code filename, 
and line number are sent to the standard error, and then calls the abort 
function. 

If the identifier NDEBUG ("no debug") is defined with #define NDEBUG then the 
macro assert does nothing. 

例子:

assert(x != 0); 

:包括assert.h

+0

另請注意http://vgable.com/blog/2008/12/04/nsassert-considered-對'assert(x!= 0 &&「是什麼嘿? 。 – 2012-09-22 17:33:30

相關問題