Reputation: 709
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....
Upvotes: 0
Views: 238
Reputation: 75058
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.
Upvotes: 1
Reputation: 25271
Make sure you run the Runloop once in a while while processing:
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantPast]];
Upvotes: 1