Assertions are mechanisms that print error messages and raise exceptions when a given condition in code is false. Logging prints error or informational messages, typically to the standard error device.
Limitations: This programming topic applies only to programs written in Objective-C. In Java there is no equivalent to assertions. For logging in Java, you can simply print messages to the standard error device or use the NSSystem method log.
This programming topic covers exception handling insofar as it relates to evaluations of given conditions and the logging of messages. For more sophisticated exception handling, namely techniques involving the raising (or throwing) and handling of exception objects, see Exceptions.
The articles covered in this programming topic are:
Last updated: 2006-04-04