So I have this code moving an NSButton to the coordinates listed
[[MyNSButton animator] setFrame:NSMakeRect(567, 228, 109, 151)];
Then I have the same code moving another NSButton
[[MyNSButton2 animator] setFrame:NSMakeRect(695, 228, 109, 151)];
What I want to do is have the first statement execute, and then when the entire animation is over, and after a delay of maybe .5 seconds, have the next one go. How can I do that?
You need to use NSTimer
Here is the code how to do that
[NSTimer scheduledTimerWithTimeInterval:.5 target:self selector:@selector(getnextButton) userInfo:nil repeats:NO];
where getnextButton is the method that would be called after .5 seconds.
put the code in this method which you want to execute after .5 seconds.
Hope this would help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With