不能在其外部的IBAction中使用变量
代码:
if timerRunning==true && timerCount==actualWorkoutLength {
timer.invalidate()
timerRunning = false
timerCount=0
timerLabel.text="0 secs"
intervalAlert()
}
答案 0 :(得分:0)
我查看截图,actualWorkoutLength
是另一种方法的局部变量。
顺便说一句:在startButton(sender: UIButton)
你永远不会看到它。
如果你想看到它。将actualWorkoutLength
声明为global variable