我想在每个输出结果之间延迟 1 秒。下面的代码没有延迟,但正在正确处理。为什么每个之间没有延迟dealCard
?
- (IBAction)startPause
{
if ([self.deal length]>cardNum) {
timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(dealCard) userInfo:nil repeats:NO];
[timer fire];
}
}
- (void) dealCard{
card.text = [NSString stringWithFormat:@"%i",cardNum+1];
cardTo.text = [self.deal substringWithRange:(NSRange){(cardNum+self.randCut)%[self.cardList count],1}];
cardNum=cardNum + 1;
[self startPause];
}