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

mac2022-06-30  22

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

 

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

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

 

 

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

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

 

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

 

转载于:https://www.cnblogs.com/bug-sniper/p/4622946.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)