如何在 if 语句中检查方法是否正在运行?例如-
if ([(UIButton *)sender isEqual:blueButton] && **showBlueText method is running** )
{
Keep playing.
}
else if ([(UIButton *)sender isEqual:blueButton] && **showBlueText method is NOT running** )
{
Game over.
}
-(void)showBlueText
{
blueText.hidden = NO;
[self performSelector:@selector(hideText) withObject:nil afterDelay:textDelay];
[self performSelector:@selector(showGreenText) withObject:nil afterDelay:hideDelay];
}
澄清一下,'showBlueText' 是它自己的循环的一部分,它独立于这个 if 语句运行。我只是想检查 showBlueText 当前是否正在运行。