I'm having trouble getting a handle on what's thread-safe in iOS drawing and 
what's not. The trouble is that the docs are so coy (and out-of-date, as far as 
I can tell). To the extent that the docs do say anything clear, it's all 
negative:

"You cannot use any UIKit's drawing methods when drawing to a CATiledLayer, and 
you cannot do your drawing inside of a UIView's -drawRect: method. Instead you 
must implement -drawLayer:inContext: and draw only using Core Graphics and 
other thread-safe functions that accept a CGContextRef to target drawing to."

"UIGraphicsBeginImageContext... You should call this function from the main 
thread of your application only."

And so forth. However, in an obscure corner of the release notes, we read (for 
iOS 4):

> • 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.

Moreover, in the WWDC videos we see CATiledLayer being drawn to via drawRect: 
with UIKit.

So what's true? And how can I find out precisely what is and isn't thread-safe? 
m.

--
matt neuburg, phd = m...@tidbits.com, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to