Your idea of โโhow it should work is wrong.
self.statusLabel.text = @"One";
This sets the value of the statusLabel field to One. This does not immediately refer to the screen. Instead, the shortcut will mark itself as the required display. At the end of the current cycle of the cycle of the cycle, all images marked as necessary displays will be drawn, and then their contents will be cleared of the screen.
Next you will do:
sleep(3); self.statusLabel.text = @"Two";
This blocks the main thread for 3 seconds (never returning to the start cycle to complete the above work), then changes the value to โTwoโ, which marks the view again as it should be displayed.
When it is ultimately drawn and reddened on the screen, the current value is Two.
It is difficult to give more specific advice on what you should do, because it is not clear if there is a real problem that you are trying to solve, or just experimenting to find out more about the infrastructure.
But you will almost never use sleep, and you certainly should not block the main flow of sleep for a few seconds.
source share