Re: Threading - How its done?
Re: Threading - How its done?
- Subject: Re: Threading - How its done?
- From: Karl von Moller <email@hidden>
- Date: Tue, 6 May 2008 14:46:44 +1000
Many thanks for your reply on this - much appreciated. I did think it
had something to do with the images being swapped out as often the
crashes occurred as I quickly changed selection in the table view.
Because I know nothing about threading, I resorted to anything to lock
the threads. That's why you see my silly attempt at Locking!
Thanks for clearing this up. Cheers Karl
On 06/05/2008, at 2:28 PM, Michael Vannorsdel wrote:
t's usually unsafe to interact with UI objects from other threads.
For instance with your image well, it may be in the middle of laying
out and drawing its image in the main thread when a secondary thread
suddenly changes the image in the middle of drawing. This can cause
all kinds of random problems (and sometimes appear to work fine)
depending at what point the image was swapped.
Try changing your UI updating in your thread to calls like:
[imageWellOutlet performSelectorOnMainThread:@selector(setImage:)
withObject:pdfImage waitUntilDone:NO];
This will make sure the update is carried out on the main drawing
thread so UI updates are consistent.
Also I'm not sure what the purpose of the lock is in the first
method, it's not really doing anything.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden