• 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
Re: [KIND OF SOLVED] Re: PDFView won't display the first time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [KIND OF SOLVED] Re: PDFView won't display the first time?


  • Subject: Re: [KIND OF SOLVED] Re: PDFView won't display the first time?
  • From: glenn andreas <email@hidden>
  • Date: Wed, 28 Mar 2007 14:59:06 -0500


On Mar 28, 2007, at 2:50 PM, Nick Zitzmann wrote:


On Mar 27, 2007, at 6:40 PM, Nick Zitzmann wrote:

However, on the very first time -setDocument: is called, the view appears completely grey on the screen, meaning it's not displaying anything. If I use the zoom controls once, then the "document" appears but is completely blank. If I use them again, then and only then does the document display correctly. Also, the - setAutoScales: option is ignored the first time, although if I call this again with different PDF data, then it works.

What's going on here?

Well, now I know what's going on: The PDFView was inside a modal window. When the window was being displayed normally, the PDFView worked as expected. Once I made the window run as modal, then the above behavior appeared.


I'm going to get a sample app together and file a bug on this as soon as I've finished this message, but in the meantime, I need an alternate PDFView class, something like what iCal uses to do its print preview in its page setup window. Does anyone have suggestions? I'd like something that users can move around by dragging the mouse (e.g. "drag mode" in Preview) as well as being able to zoom in and out, and it needs to be able to work in a modal window...

This smells like the classic "something needs to happen in the main run loop but you're running the a modal run loop so it doesn't" sort of problem that is also seen with things like embedding a WebView (or using NSURLDownload) in a dialog.



So what you can try is rolling your own modal session (beginModalSessionForWindow:, etc...), and inside that loop add:


[[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow:0.1]];

(which works for WebViews)



Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________

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: [KIND OF SOLVED] Re: PDFView won't display the first time?
      • From: Nick Zitzmann <email@hidden>
References: 
 >PDFView won't display the first time? (From: Nick Zitzmann <email@hidden>)
 >[KIND OF SOLVED] Re: PDFView won't display the first time? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: [KIND OF SOLVED] Re: PDFView won't display the first time?
  • Next by Date: Re: [KIND OF SOLVED] Re: PDFView won't display the first time?
  • Previous by thread: [KIND OF SOLVED] Re: PDFView won't display the first time?
  • Next by thread: Re: [KIND OF SOLVED] Re: PDFView won't display the first time?
  • Index(es):
    • Date
    • Thread