<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHAgY2xhc3M9 "p1"> Discuss Discussion
An assertion evaluates a condition. If the condition is false, the breakpoint handle of the current thread is called. Each thread has its own breakpoint handle, which is an object of the NSAsserttionHandler class. When called, the assertion handle prints an error message that contains the method name, class name, or function name. Then, it throws an NSInternalInconsistencyException.
Assertions evaluate a condition and, if the condition evaluates to false, call the assertion handler for the current thread, passing it a format string and a variable number of arguments. each thread has its own assertion handler, which is an object of classNSAssertionHandler. when invoked, an assertion handler prints an error message that includes des method and class names (or the function name ). it then raises anNSInternalInconsistencyException exception.
This macro is used to verify the validity of an Objective-C method. Simply provide parameters as conditions. This macro evaluates this parameter. If it is false, it prints an error log that contains the parameter and throws an exception.
This macro validates a parameter for an Objective-C method. simply provide the parameter as the condition argument. the macro evaluates the parameter and, if it is false, it logs an error message that contains des the parameter and then raises an exception.
If the pre-processing macro NS_BLOCK_ASSERTIONS asserted is defined, it will be disabled. All breakpoint macros return void.
Assertions are disabled if the preprocessor macro NS_BLOCK_ASSERTIONS is defined. All assertion macros return void.