Instance Method

restoreValuesAndReturnError:

Restores the pane’s settings.

Declaration

- (BOOL)restoreValuesAndReturnError:(NSError * _Nullable *)error;

Parameters

error

If an error occurs, in addition to returning NO you may use this parameter to return information to further describe the error. If you elect to do so, you should create an error object and use it to pass back the error information.

Return Value

YES to indicate that the settings have been initialized or restored.

Discussion

The printing system invokes this method before the pane is first shown or after the user selects a new preset.

In this required method, you should initialize or restore your custom pane’s user interface settings and internal settings. If a problem occurs, you should alert the user, initialize the settings to reasonable values as needed, and then return YES. Returning YES indicates that the printing system can proceed to show your pane.

A pane’s settings are based on values stored in printing system objects associated with the print job. To provide access to these printing system objects, the printing system creates a host object that conforms to the PDEPlugInCallbackProtocol informal protocol. The printing system passes the host object to your PDE when it sends the PDEPanelsForType:withHostInfo: message, a method in the PDEPlugIn informal protocol. Your PDE is responsible for making this host object available to its panes.

Print dialog panes use values from the print settings object or the PPD file object. Page Setup dialog panes use values from the page format object. If these printing system objects don’t contain values that correspond to your pane’s settings, you should use default values.