Waiting for a specified duration in Cocoa

前端 未结 7 2018
生来不讨喜
生来不讨喜 2020-12-29 03:41

Is there a more straightforward way to wait for a specific amount of time in Cocoa than what I have come up with below?

- (void) buttonPressed {
    [self ma         


        
7条回答
  •  悲哀的现实
    2020-12-29 03:50

    If you don't mind an asynchronous solution, here you go:

    [[NSOperationQueue currentQueue] addOperationWithBlock:^{
        [self doStuffAfterWaiting];
    }];
    

提交回复
热议问题