xib自定义UIView报错误 "forUndefinedKey:]: this class is not key value coding-compliant for the key"

使用xib自定义UIView的时候, 需要将控件拖拽成属性, 在viewController加载自定义view的时候报错误

 

"forUndefinedKey:]: this class is not key value coding-compliant for the key"

查找很久,终于发现是xib 的FILE'OWNER 的类关联出错

 

 

自定义View的时候  这个位置只能为空!!!

xib关联类应该在view的Class设置,如图

 

修改了类的关联之后,错误解决.

 

posted @ 2015-07-05 20:39  平平君  阅读(1994)  评论(0编辑  收藏  举报