Swift如何修复在

时间:2015-10-08 17:36:58

标签: ios swift storyboard

我有故事板的问题。我安装了这个:https://github.com/okmr-d/DOFavoriteButton并正确地将所有效果放在一个按钮中,但现在故事板在控制台中有很多错误,这使得应用程序非常慢。我该如何解决这个问题?谢谢!

错误

> 2015-10-08 19:33:01.629 AppName [45857:6557884] Failed to set (imageColorOn) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8a23a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOn.
2015-10-08 19:33:01.630 AppName[45857:6557884] Failed to set (imageColorOff) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8a23a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOff.
2015-10-08 19:33:01.630 AppName[45857:6557884] Failed to set (duration) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8a23a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key duration.
2015-10-08 19:33:01.938 AppName[45857:6557884] Failed to set (imageColorOn) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8afbb0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOn.
2015-10-08 19:33:01.938 AppName[45857:6557884] Failed to set (imageColorOff) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8afbb0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOff.
2015-10-08 19:33:01.938 AppName[45857:6557884] Failed to set (duration) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8afbb0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key duration.
2015-10-08 19:33:02.104 AppName[45857:6557884] Failed to set (imageColorOn) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8c3a40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOn.
2015-10-08 19:33:02.104 AppName[45857:6557884] Failed to set (imageColorOff) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8c3a40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOff.
2015-10-08 19:33:02.104 AppName[45857:6557884] Failed to set (duration) user defined inspected property on (UIButton): [<UIButton 0x7fbcec8c3a40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key duration.
2015-10-08 19:33:02.257 AppName[45857:6557884] Failed to set (imageColorOn) user defined inspected property on (UIButton): [<UIButton 0x7fbceacae5c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOn.
2015-10-08 19:33:02.257 AppName[45857:6557884] Failed to set (imageColorOff) user defined inspected property on (UIButton): [<UIButton 0x7fbceacae5c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOff.
2015-10-08 19:33:02.257 AppName[45857:6557884] Failed to set (duration) user defined inspected property on (UIButton): [<UIButton 0x7fbceacae5c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key duration.
2015-10-08 19:33:02.553 AppName[45857:6557884] Failed to set (imageColorOn) user defined inspected property on (UIButton): [<UIButton 0x7fbceadd34a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOn.
2015-10-08 19:33:02.553 AppName[45857:6557884] Failed to set (imageColorOff) user defined inspected property on (UIButton): [<UIButton 0x7fbceadd34a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageColorOff.
2015-10-08 19:33:02.553 AppName[45857:6557884] Failed to set (duration) user defined inspected property on (UIButton): [<UIButton 0x7fbceadd34a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key duration.

3 个答案:

答案 0 :(得分:1)

在我的情况下,模块没有在类下面分配。所以,我分配了模块并且一切正常。

无模块分配(错误原因):-

enter image description here

使用模块分配。 (已解决问题):-

enter image description here

答案 1 :(得分:0)

由于所选择的答案并不十分详细,因此我将在这里留给有类似问题的任何人。

我遇到了类似的问题,即“无法在(UITextField)上设置(selectedLineColor)用户定义的受检查属性:[ setValue:forUndefinedKey:]:此类不是与键值兼容的键值selectedLineColor。“

问题出在我的一个UITextField中,我最初将其类设置为SkyFloatingLabelTextField,并在属性检查器中设置了一些海关设置。当我删除该类时,文本字段仍保留自定义设置,这导致了错误。

这些设置是在身份检查器中的“用户定义的运行时属性”下设置的。

我删除了框中的密钥,错误消失了。

enter image description here

答案 2 :(得分:-2)

我看到另一个按钮(带有类UIButton)与DOFavorite类按钮的键值相同。我删除了它们,现在有效!