I want to change my UILabel\'s text after 2 seconds.
UILabel
I tried setting my UILabel\'s text to \"A text\", and use sleep(2) a
sleep(2)
The follow method is good.
You can replace your
sleep(1);
with
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC));