【发布时间】:2018-09-05 05:24:50
【问题描述】:
let newLabel = UILbael()
let button = UIButton()
button.setValue(newLabel, forKeyPath: "titleLabel")
崩溃信息
setValue:forUndefinedKey:]: this class is not key valuecoding-compliant for the key titleLabel
如果用kvc怎么办?
【问题讨论】:
-
你为什么要这样做?
-
这和你之前的问题一样。 stackoverflow.com/questions/51907176/…
标签: ios swift uibutton key-value-coding