Failed to render instance of IB Designables

在使用IB_DESIGNABLEIBInspectable关键字定义xib可视化设置属性时,遇到了这个报错:

Failed to render instance of IB Designables

如图:


Failed to render instance of IB Designables_第1张图片
clip_5.png

意思说无法渲染出这个实例对象的这个可视化属性,但原因是找不到相应的framework。
stackoverflow上的大佬给出如下解决方案:在target的build setting中添加Runpath Search Paths,笔者添加了:

@loader_path/Frameworks
@executable_path/../Frameworks
$(inherited)

另外,需要对xcode做如下额外操作:
1、清理~/Library/Developer/Xcode/DerivedData
2、shift+cmd+K 清理当前build的缓存数据
3、重新build
4、在xib上选择editor菜单的Refresh All Views菜单项等待build完成和error的消除

亲测有效.

参考链接:

Failed to render instance of IB Designables

你可能感兴趣的:(Failed to render instance of IB Designables)