How to redraw the actual screen of iPhone in the middle of any method?
There's a very long method:
- (IBA开发者_如何学Goction)buttonProcessDown
{
... // indicator started
... // active tab changed
... // any text changed
... // indicator stopped
}
How to redraw the current state of all controls on iPhone screen inside this method (4 times for all changes)?
Thanks a lot for help!
I would break the main method into 4 separate methods and use performSelector:afterDelay:
for the first method and make the same call again at the end of the second, etc. This way your code will get chance for the UI to redraw itself.
The best solution, though, is to not block the main thread at all (the UI) and to push processing if at all possible onto another thread using performSelectorInBackground
.
You do not. You have to return control back to the event loop to do drawing. What you need to do is schedule methods to fire in the future to change the UI.
精彩评论