If an error occurs during a load, the loadFromFileHandle:atOffset: method answers nil. Another way to detect an error is to send the hasErrorOccurred message to the format object (the instance of the CgFileFormat subclass). This method answers true if an error occurred in the last operation, or false if no error occurred. To determine what the error was, the currentError and currentErrorString messages can be sent to the format object. The currentError method answers an integer error code. The currentErrorString method answers a String describing the error. The following table lists the error codes and corresponding error strings.
|