Instance Method

presentError:

Presents an error alert to the user as a modal panel.

Declaration

- (BOOL)presentError:(NSError *)error;

Parameters

error

The error object encapsulating the information to present to the user.

Return Value

YES if error recovery was done; otherwise, NO.

Discussion

This method does not return until the user dismisses the alert and, if the error has recovery options and a recovery delegate, the error’s recovery delegate is sent an attemptRecoveryFromError:optionIndex: message.

The NSDocument default implementation of this method is equivalent to that of NSResponder and treats the shared NSDocumentController as the next responder and forwards these messages to it.

The default implementation of this method invokes willPresentError: to give subclasses an opportunity to customize error presentation. You should not override this method but should instead override willPresentError:.

See Also

Displaying Errors to the User

- presentError:modalForWindow:delegate:didPresentSelector:contextInfo:

Presents an error alert to the user as a modal panel.

- willPresentError:

Called when the receiver is about to present an error.

- willNotPresentError:

Confirms that the error object is not to be presented to the user and the error cannot be recovered from, so cleanup can be done.