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 to present.


The window to present the error.


The object to receive the selector.


The selector to send to the delegate.


A pointer to user-supplied data.


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 method selected by didPresentSelector must have the same signature as:

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

The default NSDocumentController implementation of this method is equivalent to that of NSResponder while treating the application object as the next responder and forwarding error presentation messages to it. (The default NSDocument implementation of this method treats the shared NSDocumentController instance as the next responder and forwards these messages to it.)

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

See Also

Handling Errors

- presentError:

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

- willPresentError:

Indicates an error condition and provides the opportunity to return the same or a different error.