Xcode Objective-C | iOS: delay function / NSTimer help?

前端 未结 7 1996
旧巷少年郎
旧巷少年郎 2021-02-01 15:32

So I\'m developing my first iOS application and I need help..

Simple program for now, I have about 9 buttons and when I press the first button, or any button, I just wan

相关标签:
7条回答
  • 2021-02-01 16:03
    [NSTimer scheduledTimerWithTimeInterval:.06 target:self selector:@selector(goToSecondButton:) userInfo:nil repeats:NO];
    

    Is the best one to use. Using sleep(15); will cause the user unable to perform any other actions. With the following function, you would replace goToSecondButton with the appropriate selector or command, which can also be from the frameworks.

    0 讨论(0)
提交回复
热议问题