views:

33

answers:

2

I am running a synchronise process on the main thread because I don't want the user to try and do anything else during the process. However I want to update the interface.

For the most part it does update, but sometimes the label I have has not quite caught up to the text I have set it.

Is there a way of forcing the UI to refresh.

I'm very scared I'm going to get clubbed about using a second thread....

+1  A: 

Make sure you run the Runloop once in a while while processing:

[[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantPast]];
Diederik Hoogenboom
I'll try this out, but it makes sense, thanks a lot.
WaterBoy
+1  A: 

Don't set text values on a background thread, have it call out to a method running on the main thread to update UI. None of the UI elements are thread safe.

Kendall Helmstetter Gelner
Good idea, thanks. I'll see if this makes a difference
WaterBoy
This worked well, thanks.
WaterBoy