Initializer

init(error:)

Returns an alert initialized from information in an error object.

Declaration

init(error: Error)

Parameters

error

Error information to display.

Return Value

An initialized alert.

Discussion

The NSAlert class extracts the localized error description, recovery suggestion, and recovery options from the error parameter and uses them as the alert’s message text, informative text, and button titles, respectively.