Skip navigation.
 
mlNSArrayController and threading
FROM : Joe Chan
DATE : Sun Dec 19 21:58:51 2004

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

Related mailsAuthorDate
mlNSArrayController and threading Joe Chan Dec 19, 21:58
mlRe: NSArrayController and threading John C. Randolph Dec 21, 00:26
mlRe: NSArrayController and threading Joe Chan Dec 22, 15:29
mlRe: NSArrayController and threading John C. Randolph Dec 22, 22:08
mlRe: NSArrayController and threading Joe Chan Dec 22, 22:27
mlRe: NSArrayController and threading Scott Stevenson Dec 22, 22:40
mlRe: NSArrayController and threading John C. Randolph Dec 23, 00:16
mlRe: NSArrayController and threading mmalcolm crawford Dec 23, 00:26
mlRe: NSArrayController and threading mmalcolm crawford Dec 23, 00:41