在Xcode6 beta 7中,每当我以这种方式添加UIPickerViewDataSource时
class MyClassVC: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {它给了我一个编译错误:
"Type MyClassVC does not conform to protocol UIPickerViewDataSource"很明显,它对Beta 6起作用,有人面临这个问题吗?
发布于 2014-09-06 13:08:53
不同的UIPickerViewDelegate和UIPickerViewDataSource方法声明在Xcode 6 beta 6和Xcode 6 beta 7之间进行了更改。为什么?大多数隐式解压选项参数已被可选或非可选参数替换。
例如,以下声明:
func pickerView(_: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String! {
return "Hello"
}现在是:
func pickerView(_: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
return "Hello"
} 检查您的UIPickerViewDelegate和UIPickerViewDataSource方法声明在UIViewControllers中。
https://stackoverflow.com/questions/25700346
复制相似问题