Problem when running the print panel in a sheet: NSPrintOperationExistsException
Problem when running the print panel in a sheet: NSPrintOperationExistsException
- Subject: Problem when running the print panel in a sheet: NSPrintOperationExistsException
- From: Berk Ozer <email@hidden>
- Date: Wed, 1 Oct 2003 08:18:40 +0200
Hi everybody!
I have encountered a problem with printing in Cocoa.
Maybe someone can help me.
Introduction
------------------------
My document-based app can open additional windows
other than the document window. The user may print
both the contents of the document window and the
additional windows. The delegate of the additional
windows implements the method
(IBAction) printDocument:(id)sender.
I handle printing by showing the print panel first.
Then, within the method
(void) printOperationDidRun:success:contextInfo:
I call
(void) print:(id)sender
method of the view, which is to be printed. Standard stuff.
The Problem
------------------------
When I run the print panel by calling
(void) runOperationModalForWindow:delegate:didRunSelector:contextInfo:
the print panel slides down and does its job.
However, the console shows this error message:
[NSPrintOperation printOperationWithView:printInfo:]: There is
already a print operation in progress
and every successive attempt at printing has no effect
except for causing this error message:
Exception occured: NSPrintOperationExistsException
I have to restart the application to be able to print again.
The funny thing is, none of these errors happen when I use
(BOOL) runOperation
which shows the print panel in a modal dialog window
instead of an attached sheet.
------------------------------
I did RTFM and also the mailing list archives but couldn't find
anything that's related. Any help is greatly appreciated.
Thanks in advance.
Berk Vzer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.