• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Printing crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Printing crash


  • Subject: Printing crash
  • From: "Jeff Hellman" <email@hidden>
  • Date: Mon, 12 Feb 2007 07:01:52 -0800

Hi All:

I'm experiencing a strange problem: printing (using a print panel)
crashes my app when running on Intel processors.  The printing code
works fine on PowerPC chips as well as when running in Rosetta.  The
code in question is as follows:

NSPrintOperation  *op = [NSPrintOperation printOperationWithView:fullTextView];
NSPrintInfo *printInfo = [op printInfo];
[printInfo setHorizontalPagination:NSFitPagination];
/* Set more printInfo settings */
[op setPrintInfo:printInfo];
[op runOperation];

I've tried all kinds of other ways to run the operation, including
runOperationModalForWindow.  After much searching on the net I ran
across a solution that involves

- (void)setCanSpawnSeparateThread:(BOOL)canSpawnSeparateThread

Essentially, the printing operation spawns another thread that, when
running on dual core chips, can cause a concurrency problem.  I
changed the printOperation so that it can't make threads, but no luck.

My only solution is to [op setShowsPrintPanel:NO] which inhibits the
print panel from displaying and causes the print operation to utilize
the default printer. Printing then works fine.  Something causes the
program to crash when displaying the print panel and I'm not sure how
to debug this.

While not a terrible solution, I'd like to get this one solved so that
I can bring back the panel.

I've tried all kinds of clean and builds, printing works fine from
other applications and this is a problem that affects all of my users
on Intel Macs.

Thanks for any help-
Jeff

--
Jeff Hellman
Planbook:  http://www.hellmansoft.com
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Printing crash
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Writing Spotlight comments
  • Next by Date: simple regex with NSTask
  • Previous by thread: Re: how to set the shortcut key in the interface builder?
  • Next by thread: Re: Printing crash
  • Index(es):
    • Date
    • Thread