Sending image from separate thread back to AppController
Sending image from separate thread back to AppController
- Subject: Sending image from separate thread back to AppController
- From: Andrew Duncan <email@hidden>
- Date: Tue, 20 Jul 2004 13:44:26 -0700
My AppController creates a new thread (call it Thread2), which runs
and, in its own good time, creates an NSImage. Now I want to tell the
main (UI) thread to display this image. Of course, Thread2 knows
nothing about the outlets to the NSImageView, so it has to ask the
AppController to deal with this.
What's the Best Practice for this one? First impulse is to give the new
thread a pointer back to the AppController. Then Thread2 can call a
method on the AppController, sending the image (pointer) and having the
AppController call setNeedsDisplay on the imageView.
But maybe there's some cool notification scheme or value observer or
something in Panther that I don't know about. I'm sure this is an FAQ
and would appreciate hearing the frequent answer.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.