Instance Method


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


- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(id)delegate didPresentSelector:(SEL)didPresentSelector contextInfo:(void *)contextInfo;



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


The window to which the modal alert belongs.


The delegate to which the selector message is sent.


The selector of the message sent to the delegate.


Object passed with the callback to provide any additional context information.


When the user dismisses the alert and any recovery possible for the error and chosen by the user has been attempted, sends the message didPresentSelector to the specified delegate.

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

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:.

The method selected by didPresentSelector must have the same signature as:

- (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void  *)contextInfo

See Also

Displaying Errors to the User

- presentError:

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.