Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
How Assertions Work
In your code you make an assertion using an assertion macro. These macros evaluate a condition and, if the condition evaluates to false, they pass a string (and possibly additional printf
-style arguments formatted into the string) describing the failure to their NSAssertionHandler. Each thread has its own NSAssertionHandler object created for it. When invoked with an assertion, an NSAssertionHandler prints an error message that includes the method and class (or function) containing the assertion and then it raises an NSInternalInconsistencyException
.
Copyright © 2006 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2006-04-04