使用@IBInspectable设置Bool失败

时间:2015-04-01 04:04:25

标签: ios

这是我的班级:

class ViewController: UIViewController {

    @IBInspectable var double: Double!
    @IBInspectable var string: String!


    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}

我在故事板中设置doublestring

enter image description here

我运行应用程序。可以正确设置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.

可以告诉我为什么设置失败了吗?谢谢!

0 个答案:

没有答案