Crashing when updating the User Interface from a detached NSThread
Crashing when updating the User Interface from a detached NSThread
- Subject: Crashing when updating the User Interface from a detached NSThread
- From: Simone Manganelli <email@hidden>
- Date: Thu, 2 Feb 2006 01:43:42 -0800
I'm having a particular problem with using NSThreads. I'm detaching
a method that runs in a separate thread, but in the process of this
method, it needs to update the user interface a bit. (I'm
multithreading the app because this method takes a particularly long
time to execute and I want the user interface to be responsive.)
Whenever this detached thread tries to update the user interface, it
seems to crash a lot.
To give a specific reason why it's necessary to update the user
interface inside this method, consider this scenario: I'm trying to
create an image from a movie by laying out each of the frames next to
each other in an image. But I want the user to know how far the
process has progressed, so I want the movie view that I'm using to
step forward and display the current frame that it's processing. I
also want to update an NSImageView to show the current assembled
image in a preview window.
Are there ways to export drawing commands back to the main
application thread so that the application doesn't crash? I tried
using an NSNotification, but that doesn't seem to work.
-- Simone Manganelli
_______________________________________________
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