• 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: iOS Rendering PDFs on a Background Thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iOS Rendering PDFs on a Background Thread


  • Subject: Re: iOS Rendering PDFs on a Background Thread
  • From: Conrad Shultz <email@hidden>
  • Date: Thu, 26 Jul 2012 15:35:19 -0700

On Jul 26, 2012, at 2:09 PM, Dave wrote:

> Hi All,
>
> I like to be able to fire off a Background thread that Renders PDF pages to UIImage's.
>
> I've got the code working on the Main Thread, but now the tricky bit because since I am using UIGraphicsBeginImageContextWithOptions and UIGraphicsEndImageContext in order to capture the Image, and, as far as I know these methods can only be called on the Main Thread. Is this correct?


As David has pointed out, this is incorrect as of iOS (then iPhoneOS) 4.  From the release notes (http://developer.apple.com/library/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iPhoneOS4.html):

Drawing to a graphics context in UIKit is now thread-safe. Specifically:
The routines used to access and manipulate the graphics context can now correctly handle contexts residing on different threads.
String and image drawing is now thread-safe.
Using color and font objects in multiple threads is now safe to do.

I do see that the UIKit documentation has not been updated to reflect this fact.  I suggest filing a documentation bug.

-Conrad
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

References: 
 >iOS Rendering PDFs on a Background Thread (From: Dave <email@hidden>)

  • Prev by Date: Re: iOS Rendering PDFs on a Background Thread
  • Next by Date: NSPointerArray compact
  • Previous by thread: Re: iOS Rendering PDFs on a Background Thread
  • Next by thread: NSPointerArray compact
  • Index(es):
    • Date
    • Thread