COError class documentation

COError : NSError

NSError subclass to report multiple errors or a validation result

AuthorsGenerated by qmathe
Declared inCOError.h


  • An aggregate error contains suberrors in -errors (a suberror can contain other suberrors).
  • A validation error contains a validation issue in -validationResult .

COError is used by CoreObject validation support such as -[COObject validate] and COEditingContext commit methods such as -[COEditingContext commitWithIdentifier:metadata:undoTrack:error:] .

-[COError domain] returns kCOCoreObjectErrorDomain.


+ (id) errorWithErrors: (id )suberrors

Returns a new autoreleased error that includes suberrors.

Returns nil when the error array is empty.

    + (id) errorWithValidationResult: (ETValidationResult *)aResult

    Returns a new autoreleased error based on a validation result.

      + (NSArray *) errorsWithValidationResults: (id )errors

      Returns new autoreleased error array where every error corresponds to validation result.

        + (id) errorWithValidationResults: (id )errors

        Returns a new autoreleased error that includes validations results put into suberrors.

          Basic Properties

          - (NSArray *) errors

          Returns the suberrors.

          An error that reports a -validationResult will return always an empty array.

          When the suberrors are validation errors, -code returns kCOValidationMultipleErrorsError.

            - (ETValidationResult *) validationResult

            Returns a validation result.

            An error that contains suberrors with -errors will always return nil.

            When the validation result is not nil, -code returns kCOValidationError.