已删除的IBInspectable属性会生成警告日志

时间:2015-03-04 08:58:01

标签: xcode properties interface-builder warnings ibinspectable

我在课堂上使用了几个@IBInspectable属性,之后我改变主意并删除了它们。虽然,似乎IB仍在尝试设置它们,并且每次运行都会产生类似警告:

2015-03-04 11:47:10.288 2D[29075:939900] Failed to set (shapeAsInt) user defined inspected property on (_D.ShapeButton): [<_D.ShapeButton 0x12fe25340> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key shapeAsInt.
2015-03-04 11:47:10.289 2D[29075:939900] Failed to set (colorAsInt) user defined inspected property on (_D.ColorButton): [<_D.ColorButton 0x12fd21800> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key colorAsInt.

虽然日志不会导致应用程序崩溃,但它们非常烦人。

还有其他人遇到过这个吗?你是怎么修好的?

2 个答案:

答案 0 :(得分:1)

在Xcode中的 Identity Inspector 中,使用User Defined Runtime Attributes符号从-中删除属性

screenshot

答案 1 :(得分:0)

好吧,你可以手动删除它 - 这很容易。打开导致外部编辑器问题的故事板(右键单击故事板并从上下文菜单中选择&#34;使用外部编辑器打开&#34;),找到包含已删除属性的行并删除该行。完成