【发布时间】:2014-10-01 02:02:22
【问题描述】:
所以我想跟踪用户想要循环的方向。因此我有一个分段控件来选择方向。
代码如下:
@IBOutlet weak var cycleSwitch: UISegmentedControl!
@IBAction func setCycleDirection(sender: AnyObject) {
switch cycleSwitch.selectedSegmentIndex
{
case 0:
cycleDirection = cycleSwitch.selectedSegmentIndex
case 1:
cycleDirection = cycleSwitch.selectedSegmentIndex
default:
break
}
println(cycleDirection)
}
但是什么都没有打印出来。即使我将所有内容都注释掉并且只有 println("Im in the action") 不会记录。我也尝试过这个好像语句,例如cycleSwitch.selectedSegmentIndex == 0 等等。都不起作用。
关于为什么价值观不会改变的任何建议或想法?
【问题讨论】: