NSArrayController and threading
NSArrayController and threading
- Subject: NSArrayController and threading
- From: Joe Chan <email@hidden>
- Date: Sun, 19 Dec 2004 15:58:51 -0500
I have a general question about threading and NSArrayController. For
the model objects that I need to display in a NSTableView, one of the
columns is for thumbnails (and the model object has a thumbnail key
that returns an NSImage). Since loading a bunch of thumbnails can take
a while, I'm planning to have the model object returns a placeholder
NSImage, and then go off and fetch the thumbnail in a the thread. My
question is how to do so safely. There is no indication that
NSArrayController is thread safe, and having another thread calling
[obj setThumbnail] after the thumbnail is loaded (which trigger all the
KVO stuff in that thread) is probably a bad idea. One idea I have is to
set up a work queue and and NSTimer in the main thread to retrieve the
thumbnail as they are loaded. Any better ideas?
--
Joe Chan
Sun Microsystems, Inc.
Burlington, MA
Tel: (781) 442-0809
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden