Instance Method


Runs the print operation, calling your custom delegate method upon completion.


- (void)runOperationModalForWindow:(NSWindow *)docWindow delegate:(id)delegate didRunSelector:(SEL)didRunSelector contextInfo:(void *)contextInfo;



The document window to receive a print progress sheet.


The printing delegate object. Messages are sent to this object.


The delegate method called after the completion of the print operation.


A pointer to any data you want passed to the method in the didRunSelector parameter.


The method specified by the didRunSelector parameter must have the following signature:

- (void)printOperationDidRun:(NSPrintOperation *)printOperation  success:(BOOL)success  contextInfo:(void *)contextInfo

The value of success is YES if the print operation ran to completion without cancellation or error, and NO otherwise.

If you send canSpawnSeparateThread to an NSPrintOperation object with an argument of YES, then the delegate specified in a subsequent invocation of runOperationModalForWindow:delegate:didRunSelector:contextInfo: may be messaged in that spawned, non-main thread.

See Also

Running a Print Operation

- runOperation

Runs the print operation on the current thread.

- cleanUpOperation

Called at the end of a print operation to remove the receiver as the current operation.

- deliverResult

Delivers the results of the print operation to the intended destination.