[英]Can't use variable inside of an IBAction outside of it
I look your screenshot and actualWorkoutLength
is a local variable of another method. 我看了看您的屏幕截图,
actualWorkoutLength
是另一种方法的局部变量。
BTW: In startButton(sender: UIButton)
you will never see it. 顺便说一句:在
startButton(sender: UIButton)
您将永远看不到它。
If you want to see it. 如果您想看到它。 Declare
actualWorkoutLength
as global variable
将
actualWorkoutLength
声明为global variable
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.