UIPickerView 正在冻结 UI

UIPickerView is freezing the UI

我正在 Swift 中实现一个简单的选择器视图。一切都已连接好,这是我目前拥有的所有代码:

//MARK: - picker data and delegates

func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int
{
    return 2
}

func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
    return self.visableScores
}

func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String!
{
    return "\(row)"
}

func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)
{

}

visableScores 是一个整数。

出于某种原因,当我尝试在选择器视图上滚动时,UI 冻结并且变得几乎没有响应。我从未使用过选择器视图。我是不是做错了什么,或者我应该去别处寻找 UI 冻结的原因?

原来只是重启模拟器而已。

退出模拟器,运行重新启动项目,一切正常

从那时起就发生了,现在我对任何奇怪行为的默认操作是重新启动 Xcode 和模拟器。