My application has a button when clicked it is disabled, an activity indicator displayed and a background task is executed. When this task is completed a callback updates the interface by enabling the button and removing the activity indicator. The problem I having is the task is completing the callback function is executed but for a period of time the activity monitor remains on the screen, the button looks like it is disabled but it is possible to click it again. Can anyone tell me where I am going wrong?
Thanks very much!
Could it be that the callback-method is being executed in a separate thread?
I’m asking, because any calls that have impact on a view should be performed on the main thread.
The problem might be solved by doing the following:
It could look a little bit like this: