Protocol: NSErrorRecoveryAttempting

Overview

The NSErrorRecoveryAttempting informal protocol provides methods that allow your application to attempt to recover from an error. These methods are invoked when an NSError object is returned that specifies the implementing object as the error recoveryAttempter and the user has selected one of the error’s localized recovery options.Implemented to attempt a recovery from an error noted in an application-modal dialog.Implemented to attempt a recovery from an error noted in an document-modal sheet.

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) attemptRecoveryFromError(error, optionIndex:recoveryOptionIndex)

Implemented to attempt a recovery from an error noted in an application-modal dialog. Invoked when an error alert is been presented to the user in an application-modal dialog, and the user has selected an error recovery option specified by error.

Parameters:

  • error (NSError)

    An NSError object that describes the error, including error recovery options.

  • recoveryOptionIndex (Integer)

    The index of the user selected recovery option in error's localized recovery array.

Returns:

  • (Boolean)

    YES if the error recovery was completed successfully, NO otherwise.

- (Object) attemptRecoveryFromError(error, optionIndex:recoveryOptionIndex, delegate:delegate, didRecoverSelector:didRecoverSelector, contextInfo:contextInfo)

Implemented to attempt a recovery from an error noted in an document-modal sheet. Invoked when an error alert is presented to the user in a document-modal sheet, and the user has selected an error recovery option specified by error. After recovery is attempted, your implementation should send delegate the message specified in didRecoverSelector, passing the provided contextInfo. The didRecoverSelector should have the following signature:

where didRecover is YES if the error recovery attempt was successful; otherwise it is NO.

Parameters:

  • error (NSError)

    An NSError object that describes the error, including error recovery options.

  • recoveryOptionIndex (Integer)

    The index of the user selected recovery option in error’s localized recovery array.

  • delegate (Object)

    An object that is the modal delegate.

  • didRecoverSelector (Symbol)

    A selector identifying the method implemented by the modal delegate.

  • contextInfo (Object)

    Arbitrary data associated with the attempt at error recovery, to be passed to delegate in didRecoverSelector.

Returns: