Displaying progress of lengthy operation: complication with bindings and threads
Displaying progress of lengthy operation: complication with bindings and threads
- Subject: Displaying progress of lengthy operation: complication with bindings and threads
- From: "Sean McBride" <email@hidden>
- Date: Fri, 31 Mar 2006 13:50:50 -0500
- Organization: Rogue Research
Hi all,
Some operations in my app take several minutes and so the app currently
SPODs; I would prefer to add a progress bar. The app uses bindings and
is single threaded.
One idea is to spawn a worker thread to do the lengthy work like this:
for (num items)
lengthy computation
performSelectorOnMainThread:@selector(advanceProgBar:)
But the 'lengthy computation' part would read and write to my model
objects, and those objects are connected to UI objects via bindings.
I've searched the archives and this has been discussed before. KVC/KVO/
bindings are not thread safe. Which- I believe, I'm no threading
expert- means it's entirely unsafe for my worker thread to touch any
object that is involved in bindings.
So now I'm really unsure of how to best approach this, any suggestions?
Thanks!
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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