On Sat, Jan 24, 2009 at 7:10 PM, Alex Kac <a...@webis.net> wrote:
> UIKit/AppKit are not thread-safe meaning we should never do drawing on a
> background thread. Yet, if we have say 5 views and for performance reasons
> we want the main view to draw first and then the other 4 to draw in the
> background like how CoverFlow will draw its icons/images seemingly in the
> background, how does one do that?

1) Are you sure you want to use separate views for each item in your
CoverFlow-esque interface?  You could use layers or cells.

2) Perform all your loading and rendering into an offscreen image and
then use performSelectorOnMainThread: to schedule the drawing for the
next runloop iteration.  You get all the benefits of multithreading
the I/O bound portion of your code.  Yes, you still have to do the
pixel-pushing on the main thread but that's an artifact of the
architecture.

--Kyle Sluder
_______________________________________________

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