这是我的班级:
class ViewController: UIViewController {
@IBInspectable var double: Double!
@IBInspectable var string: String!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
我在故事板中设置double
和string
我运行应用程序。可以正确设置string
,但double
失败。控制台输出:
Failed to set (double) user defined inspected property on (Test1.ViewController): [<Test1.ViewController 0x7f892ad25910> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key double.
可以告诉我为什么设置失败了吗?谢谢!